Capturing External Data

Some applications require SQL Server to reflect a current data value from the external environment. A currency-trading application, for example, might need to get a current exchange value from a wire service. With conventional client-server techniques, a client program would obtain this value and then update the server. Using Open Data Services, however, this value can be obtained by SQL Server, when required, from an Open Data Services server application. SQL Server calls the Open Data Services server application as a remote stored procedure, and then the Open Data Services server application sends the current value or values back to SQL Server in the form of return parameters. This value can then be stored in a table or incorporated into a Transact-SQL procedure as required.

Example

The PROCSRV and the XP.DLL sample applications demonstrate this type of application. When SQL Server calls the PROCSRV diskfree or the XP.DLL xp_diskfree remote stored procedure, passing a drive letter as a parameter to the procedure, the procedure returns the amount of free space on the drive.