Sample Extended Stored Procedures

Extended Stored Procedure Programming

Extended Stored Procedure Programming

Sample Extended Stored Procedures

The Open Data Services samples are installed by the Microsoft® SQL Server™ 2000 setup program in subdirectories under x:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Samples\ODS. All of the necessary C source, definition, project, and .sql files for the samples are located in these subdirectories.

Extended stored procedure DLL Source file subdirectory
Description
xp_hello Xp_hello.dll xp_hello Basic extended stored procedure that accepts one output parameter and prints one result set.
xp_srv_paraminfo_sample Xp_param.dll xp_param Analyzes parameters from an extended stored procedure call, and posts a result set to the client about each parameter and parameter value.
xp_gettable_odbc Xp_odbc.dll xp_odbc Uses ODBC to open a bound connection to the same instance of 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.
xp_gettable_dblib Xp_dblib.dll xp_odbc Uses the DB-Library interface to open a bound connection to the same instance of 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.

To create the extended stored procedure DLLs for these samples, go to the appropriate sample subdirectory. Using Microsoft Visual C++® 6.0, open the .dsw file and compile this program. Perform these steps before you compile:

1.    On the Tools menu, click Options, and then click the Directories tab.

2.    In the Show directories for box, select Include files and Library files. Ensure these directories (as appropriate) are included and also appear on the top list:

  • Include files: ..\Tools\Devtools\Include

  • Library files: ..\Tools\Devtools\Lib

See Also

Adding an Extended Stored Procedure to SQL Server

Creating Extended Stored Procedures

Debugging an Extended Stored Procedure

Removing an Extended Stored Procedure from SQL Server

Using Bound Connections