[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-atl
Subject:    Re: OT: How to call a C++ service from a SQL Server Trigger
From:       "Th. Schwarz" <ThomasSchwarz () SWOL ! DE>
Date:       2000-06-29 20:51:40
[Download RAW message or body]


Sunit...

Without knowing any details of your design a word of warning... ;-)

I'd be extremely cautious about calling out-of-proc code (e.g. a service)
from an SQL Server trigger. This means looking for trouble. A function in a
DLL (in-process) is about as far as I'd go here. One way to do what you need
is record some sort of action in another table from the trigger and poll
that table from the service (loosely coupled)...

2 cents you didn't ask for from me...

Thomas Schwarz
The COM Factory
ThomasSchwarz@swol.de

Herma Ness Golden Retrievers
http://www.hermaness.com


-----Original Message-----
From: ATL - Active Template Library [mailto:ATL@DISCUSS.MICROSOFT.COM]On
Behalf Of Sunit Katkar
Sent: Donnerstag, 29. Juni 2000 21:59
To: ATL@DISCUSS.MICROSOFT.COM
Subject: [ATL] OT: How to call a C++ service from a SQL Server Trigger


Hi,

I have SQL server database on NT4.0. There is a trigger whenever a certain
action happens (like addition of a new record). There is a C++ service
running on the same server. (Service built by another team using the ATL
Wizard - VC++6.0 SP3)

I need to call a method in this service whenever the SQL Server fires the
trigger.

(I thought of one approcach where we can launch a command shell from the
trigger and then call a small C++ program which would call the NT Service
everytime the trigger fired, but this did not seem to be the right way)

How can this be achieved? I am a (fast learning) newbie to COM and ATL.
Any code samples, etc. will really help!

Thanks in advance.

Sunit Katkar

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

----------------------------------------------------------------
Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic