Monitor data changes in SQL Azure

别来无恙 提交于 2019-11-26 14:47:44

问题


Is there a way to to get notifications when SQL Azure data changes or when new data is inserted? I would like to send notifications to an ASP.NET web application and push notifications to a Windows Phone. I know that the SqlDependency class and Query notifications are used to monitor SQL Server 2008 database data changes but SQL Azure doesn't support this yet.


回答1:


Sorry but you don't have any options available other than rolling your own notification mechanism. One of the ways you could do this is to create triggers on the table you want to monitor and test for field-level updates, store the event in a secondary table, and code your application to read those events on a specific frequency. The COLUMNS_UPDATED function can help you figure out which fields were changed inside a trigger.




回答2:


One option that might work for you is to use a cron service like Aditi Scheduler. The way you might achieve this is to have some service URL that when called makes a call to your SQL Azure db to detect if new data is inserted and then send the notification when there is new data. You would then configure the Aditi scheduler to call this service endpoint say every 10 min. The Aditi scheduler would be free (I believe) if you use it to call your service no more frequently than every 10 min.



来源:https://stackoverflow.com/questions/9880091/monitor-data-changes-in-sql-azure

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