Sql server trigger to .Net call

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. How to keep Stored Procedures and other scripts in SVN/Other repository?
  3. Invalid Column Name Exception on Entity Framework
  4. What is this pattern in SQL
  5. Matching criteria for the below scenario
  6. Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC)
  7. SQL Server Datetime Subquery Conversion Error?
  8. An application which checks continuously for changes in the table using a select statement, get the particular record -> send through service.

  9. Something else?

  • Transform rows into columns
  • Select row data in addition to structured XML data
  • PHP form inserting <br> at the end of the text on each submission to MSSQL
  • improving query times a sql ip lookup database
  • File table with clustered index
  • How to execute .sql file using powershell?
  • 2 Solutions collect form web for “Sql server trigger to .Net call”

    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.

    A long time ago I worked on an application that
    for each “data” table

    • Had a history table that record all inserts, deletes and changes
    • Each ‘logical’ transaction had a history ID, that could be used to find it’s changes across all the history tables
    • The history IDs were ints that increased in value, so a 3rd party system to find all changes since it’s last check by doing a select from XyxHistory where historyId > lastProcessHistoryId
    • Trigger were used to update the history tables
    • Most of the above was generated using codesmith from the data tables

    This allowed many 3rd party systems to be integrated without having to change the main application code.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.