SQL Server has a feature called query notification. It will sendThe application submits a messagequery and some parameters. This is know as a subscription. If data changes so the result of this query would be different with the new data, the notification fires.
From BoL:
Query notification subscriptions must be created from a database access interface. Transact-SQL does not provide a mechanism for creating query notification subscriptions.
That link has several options for creating a notification. There are restrictions on what the query may look like.
Query Notifications are processed through Service Broker (SB), so that has to be configured on the instance. When the notification fires a message is inserted into the stated queue. These queues are no different than other SB queues so all the ACID and authorisation rules apply.
The application listens on this queue and reacts when the underlyingmessage arrives. The application can poll or have a thread sitting blocked, waiting for a message. When the notification is sent the subscription is dropped. The application must submit a new subscription to receive further notification. This may cause race conditions, or allow intervening data becomes stalechanges to be missed. Be
Be careful, though, if you have many active clients and frequently changing data as it can add a significant load to the server.