C#/SQL Database listener

后端 未结 6 1073
挽巷
挽巷 2020-12-10 13:14

I have a requirement to monitor the Database rows continuously to check for the Changes(updates). If there are some changes or updates from the other sources the Event shoul

6条回答
  •  -上瘾入骨i
    2020-12-10 13:36

    I had a very similar requirement some time ago, and I solved it using a CLR SP to push the data into a message queue.

    To ease deployment, I created an CLR SP with a tiny little function called SendMessage that was just pushing a message into a Message Queue, and tied it to my tables using an AFTER INSERT trigger (normal trigger, not CLR trigger).

    Performance was my main concern in this case, but I have stress tested it and it greatly exceeded my expectations. And compared to SQL Server Service Broker, it's a very easy-to-deploy solution. The code in the CLR SP is really trivial as well.

提交回复
热议问题