Responding to SQL Server Updates

Client-server architecture assumes that when a client wants the latest data from the server, the client makes a request to the server. Therefore, SQL Server responds to client requests but never initiates the conversation. In some applications, however, a client must be notified when a key piece of data changes at the server. A stockbroker, for example, might want to know immediately if the price of a particular security changes by more than a certain percentage. With standard client-server architecture, the stockbroker's client application would need to query the server frequently to see whether the data had changed. This activity costs processing resources, both at the client and at the server.

The remote stored procedure capabilities of Open Data Services offer a simple solution to this problem. In SQL Server, you can place a trigger on the table of interest. When data in the table changes, the trigger activates a remote stored procedure call to an Open Data Services server application, passing the name of the client that needs notification as a parameter in the procedure call. Then, in the Open Data Services server application, the remote stored procedure event handler can call an external application that can notify a user of the update.

Example

The PROCSRV sample application, included with Open Data Services, shows how an Open Data Services server application can notify a client of a SQL Server update by triggering a process that is external to SQL Server, such as a LAN Manager net send command.