I have a table that will receive messages from a 3rd party software, I need a triggering mechanism to call my dotnet code. What are are the pros and cons of a trigger calling a SQLCLR which then could call a web service for example vs just having my code poll the table for changes. Is suspect the average load of the table will be very little, maybe a few thousand transactions a day.
Share
You don’t say what version of SQL Server you’re using, but if it’s 2005+, Service Broker was made for this. In your trigger, put a (short) message on the queue. Have your service execute a WAITFOR on the queue which will then trigger a RECIEVE to grab the message. Better than spinning cycles seeing if there’s nothing to do.