SqlServer Notifications to C# App ?

  • Thread starter Thread starter cybertof
  • Start date Start date
C

cybertof

Hello,

Is there a way to be notified that "something happened" inside a
SqlServer Table ?

Is there a way to communicate this notification/event to a C#
application ?


Regards,
Cybertof.
 
Cybertof,

You could use a trigger on each table you want to watch and then send an
appropriate message. However, I can understand that how this would be
difficult to maintain.

SQL server does have a notification service available. There is an
article on this in MSDN magazine titled "Build Apps that Provide Real-Time
Information and Customized Content Using SQL Server Notification Services",
located at (watch for line wrap):

http://msdn.microsoft.com/msdnmag/issues/02/11/SQLServerNotificationServices/default.aspx

Hope this helps.
 
Nicholas,

I'm new to SqlServer.
In which cases are trigger used ?
Is it most of the time triggers that trigger something inside SqlServer
itself ? (procedures ? other ?)

Thanks.
Cybertof.
 
Cybertof,

A trigger is really just a stored procedure that is called when an
operation takes place on a table (add, edit, delete). You have to set them
explicitly. From inside the trigger, you can do things like call extended
stored procedures (functions exported from DLLs) or I believe you can call
COM objects as well.
 
Back
Top