Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql server trigger to .Net call [closed]

Whenever a record is inserted or updated in a sql server table, I have to call a third party service which will insert/update their table. What is the most efficient way to do this?

  1. SQL server trigger to .Net call (I'm not sure if this is possible... Is it possible to send the id of the record to a .Net application whenever insert/update occurs?)

  2. An application which checks continuously for changes in the table using a select statement, get the particular record -> send through service.

  3. Something else?

like image 298
user441660 Avatar asked Mar 23 '26 11:03

user441660


1 Answers

In SQL Server 2005 and above, you have the ability to create CLR Stored Procedures, which are stored procedures that run standard .Net code, as opposed to SQL related code. There are some limitations to what it can do, but you could easily create an insert trigger that passes the @@IDENTITY of the new record added to a CLR stored procedure that does the .Net processing you need.

like image 61
Dillie-O Avatar answered Mar 26 '26 01:03

Dillie-O



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!