SQL Server 2000 real time notification to .net C#

  • I have an external system thats going to insert data into my sql server 2000 database tables. I want to have a trigger on a table that can notify a .net C# server (that I am running on a separate Windows 2000 machine) about the record inserted into the table. Since I want this to happen in real time, I cannot have the server poll the database, but want the database to notify the server, so the server can handle the inserted data. Whats the best approach for this? Help would be greatly appreciated.

  • There are multiple ways to do this. You could have SQL post to a web service for example. But I would recommend MSMQ:

    - trigger calls a DTS package

    - DTS package sends a MSMQ message

    - .Net app on other server receive the call via MSMQ

    There is a small delay but delivery is garantied and it will work even is your application is offline for a while. And its easy to do.

    You don't want a trigger to call anything that is slow to respond or that might fail.

    Still another way is to save info in a text file and have the .Net app register itself to the new file event of that folder. This will be very fast. This is even simpler. But keep in mind that a mapped drive is not always reachable. So create the file in a local folder (so the trigger won't fail if you are rebooting the 2nd server) and use robocopy or some such to mirror it to server B)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply