System Stored Procedures
Many administrative and informational activities in Microsoft® SQL Server™ can be performed through system stored procedures. The system stored procedures are grouped into these categories.
Category |
Description |
Active Directory Procedures |
Used to register instances of SQL Server and SQL Server databases in Microsoft Windows® 2000 Active Directory™. |
Catalog Procedures |
Implements ODBC data dictionary functions and isolates ODBC applications from changes to underlying system tables. |
Cursor Procedures |
Implements cursor variable functionality. |
Database Maintenance Plan Procedures |
Used to set up core maintenance tasks necessary to ensure database performance. |
Distributed Queries Procedures |
Used to implement and manage Distributed Queries. |
Full-Text Search Procedures |
Used to implement and query full-text indexes. |
Log Shipping Procedures |
Used to configure and manage log shipping. |
OLE Automation Procedures |
Allows standard OLE automation objects to be used within a standard Transact-SQL batch. |
Replication Procedures |
Used to manage replication. |
Security Procedures |
Used to manage security. |
SQL Mail Procedures |
Used to perform e-mail operations from within SQL Server. |
SQL Profiler Procedures |
Used by SQL Profiler to monitor performance and activity. |
SQL Server Agent Procedures |
Used by SQL Server Agent to manage scheduled and event-driven activities. |
System Procedures |
Used for general maintenance of SQL Server. |
Web Assistant Procedures |
Used by the Web Assistant. |
XML Procedures |
Used for Extensible Markup Language (XML) text management. |
General Extended Procedures |
Provides an interface from SQL Server to external programs for various maintenance activities. |
Note Unless specifically documented otherwise, all system stored procedures return a value of 0, which indicates success. To indicate failure, a nonzero value is returned.
API System Stored Procedures
Users running SQL Profiler against ADO, OLE DB, ODBC, and DB-Library applications may notice the use of system stored procedures that are not covered in the Transact-SQL Reference. These stored procedures are used by the Microsoft OLE DB Provider for SQL Server, the SQL Server ODBC driver, and the DB-Library dynamic-link library (DLL) to implement the functionality of a database API. These stored procedures are simply the mechanism the provider or drivers use to communicate user requests to SQL Server. They are intended only for the internal use of the OLE DB Provider for SQL Server, the SQL Server ODBC driver, and the DB-Library DLL. Calling them explicitly from an SQL Server application is not supported.
The complete functionality from these stored procedures is made available to SQL Server applications through the API functions they support. For example, the cursor functionality of the sp_cursor system stored procedures is made available to OLE DB applications through the OLE DB API cursor properties and methods, to ODBC applications through the ODBC cursor attributes and functions, and to DB-Library applications through the DB-Library Cursor Library.
These system stored procedures support the cursor functionality of ADO, OLE DB, ODBC, and the DB-Library Cursor Library:
sp_cursor |
sp_cursorclose |
sp_cursorexecute |
sp_cursorfetch |
sp_cursoropen |
sp_cursoroption |
sp_cursorprepare |
sp_cursorunprepare |
|
These system stored procedures support the prepare/execute model of executing Transact-SQL statements in ADO, OLE DB, and ODBC:
sp_execute |
sp_prepare |
sp_unprepare |
The sp_createorphan and sp_droporphans stored procedures are used for ODBC ntext, text, and image processing.
The sp_reset_connection stored procedure is used by SQL Server to support remote stored procedure calls in a transaction.
The sp_sdidebug stored procedure is used by SQL Server for debugging Transact-SQL statements.