How do I listen for SQL Server database changes

浪尽此生 提交于 2019-12-22 04:49:09

问题


Using .Net 4.0 and SQL Server 2008 R2

I have been looking into utilizing SqlDependency / SqlNotifications for monitoring some database structures. Is the best process / practice for this to utilize the SqlDependency / SqlNotifications with SQL Server Service broker?

Are folks using other methods to accomplish a similar task? I could always poll for changes, but I would rather not have to do that. On the other hand I don't want to introduce a complex scenario into our existing environment either.

EDIT (Potential Options):

  1. SqlDependency
  2. Service Broker External Activation

回答1:


Check out event notifications:

http://msdn.microsoft.com/en-us/library/ms175854.aspx



来源:https://stackoverflow.com/questions/9299620/how-do-i-listen-for-sql-server-database-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!