Using xp_gettable_odbc

Extended Stored Procedure Programming

Extended Stored Procedure Programming

Using xp_gettable_odbc

This Microsoft® Visual C++® sample shows using ODBC to open a bound connection to the same instance of Microsoft SQL Server™ that called the extended stored procedure. The server returns a result set to the extended stored procedure, which passes the result set to the client.

You must create an ODBC datasource called "local" or edit the code to change the datasource name.

Default Location

x:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\ODS\Xp_odbc

Running the Sample

To create the extended stored procedure DLLs for these samples, go to the appropriate sample subdirectory and open the supplied .dsw file with Microsoft Visual C++.

To run this program

  1. Build and compile the Xp_odbc.dll.

  2. Place the compiled Xp_odbc.dll in the Microsoft SQL Server\80\Tools\Binn directory.

  3. Start the server.

  4. Start SQL Query Analyzer, and then run the Xp_odbc.sql script.
Remarks

xp_gettable_odbc works only on an instance of SQL Server running on Microsoft Windows® 2000 or Microsoft Windows NT® 4.0.

See Also

Using Bound Connections

Samples