监视SQL Azure中的数据更改

时间:2022-04-25 15:49:51

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.

是否有一种方法可以在SQL Azure数据更改或插入新数据时获得通知?我想向ASP发送通知。NET web应用程序,并将通知推送到Windows Phone上。我知道SqlDependency类和查询通知用于监视SQL Server 2008数据库数据的更改,但是SQL Azure还没有支持这一点。

2 个解决方案

#1


3  

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.

对不起,除了滚动您自己的通知机制之外,您没有任何可用的选项。其中一种方法是在要监视和测试字段级更新的表上创建触发器,将事件存储在辅助表中,并编写应用程序以读取特定频率的事件。columns_updates函数可以帮助您确定触发器中哪些字段被更改。

#2


0  

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.

一个可能对您有用的选项是使用类似Aditi调度器的cron服务。实现这一点的方法是使用一些服务URL,在调用时调用SQL Azure db来检测是否插入了新数据,然后在有新数据时发送通知。然后将Aditi调度器配置为每10分钟调用此服务端点。如果您使用Aditi调度器调用您的服务的频率不超过每10分钟。

#1


3  

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.

对不起,除了滚动您自己的通知机制之外,您没有任何可用的选项。其中一种方法是在要监视和测试字段级更新的表上创建触发器,将事件存储在辅助表中,并编写应用程序以读取特定频率的事件。columns_updates函数可以帮助您确定触发器中哪些字段被更改。

#2


0  

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.

一个可能对您有用的选项是使用类似Aditi调度器的cron服务。实现这一点的方法是使用一些服务URL,在调用时调用SQL Azure db来检测是否插入了新数据,然后在有新数据时发送通知。然后将Aditi调度器配置为每10分钟调用此服务端点。如果您使用Aditi调度器调用您的服务的频率不超过每10分钟。