Extended Stored Procedures

Creating and Maintaining Databases

Creating and Maintaining Databases

Extended Stored Procedures

Extended stored procedures allow you to create your own external routines in a programming language such as C. The extended stored procedures appear to users as normal stored procedures and are executed in the same way. Parameters can be passed to extended stored procedures, and they can return results and return status. Extended stored procedures can be used to extend the capabilities of Microsoft® SQL Server™ 2000.

Extended stored procedures are dynamic-link libraries (DLLs) that SQL Server can dynamically load and execute. Extended stored procedures run directly in the address space of SQL Server and are programmed using the SQL Server Open Data Services API.

After an extended stored procedure has been written, members of the sysadmin fixed server role can register the extended stored procedure with SQL Server and then grant permission to other users to execute the procedure. Extended stored procedures can be added only to the master database.

Note  Extended stored procedures may produce memory leaks or other problems that reduce the performance and reliability of the server. You should consider storing extended stored procedures in an instance of SQL Server separate from the instance containing the referenced data and using distributed queries to access the database. For more information, see Distributed Queries.

To add an extended stored procedure

Transact-SQL