Registering the Extended Stored Procedure

Feature Only in Enterprise Editions   Using the Extended Stored Procedure Wizard to create an extended stored procedure is supported only in Visual C++ Enterprise Editions. For more information, see .

You must register an extended stored procedure with SQL Server before it can be used. You can register the extended stored procedure using a Visual Studio Database Project.

To register an extended stored procedure

  1. Create a database project (see Visual C++ information in ), adding it to your current workspace, and add a data connection for the server where you want to register the extended stored procedure. You must use the server's Master database.

  2. Click the Data View tab and open the folder for your data connection. You will see a sub-folder for the extended stored procedures on that server.

  3. Right-click on the Extended Stored Procedures folder and choose New Extended Stored Procedure from the shortcut menu. A dialog box will prompt you for the name of your extended stored procedure and the name of the DLL. It is best not to include a full path to the DLL, just the filename, for example MyXp.DLL not c:\MyVCProjects\MyXp\debug\MyXp.DLL.

  4. Copy the DLL to the directory that contains sqlservr.exe, for example c:\mssql\binn  on the server machine, or a directory that is included in the system search path for that server. SQL Server uses the Win32 API LoadLibrary to locate extended stored procedure DLLs so your new DLL needs to reside in the system path. In the Project Settings dialog box you can use a Post-Build step (see ) to automate copying the DLL to the correct directory.