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 |
---|---|
Catalog Procedures | Implements ODBC data dictionary functions and isolates ODBC applications from changes to underlying system tables. |
Cursor Procedures | Implements cursor variable functionality. |
Distributed Queries Procedures | Used to implement and manage Distributed Queries. |
SQL Server Agent Procedures | Used by SQL Server Agent to manage scheduled and event driven activities. |
Replication Procedures | Used to manage replication. |
Security Procedures | Used to manage security. |
System Procedures | Used for general maintenance of SQL Server. |
Web Assistant Procedures | Used by the Web Assistant. |
General Extended Procedures | Provides an interface from SQL Server to external programs for various maintenance activities. |
SQL Mail Extended Procedures | Used to perform e-mail operations from within SQL Server. |
SQL Server Profiler Extended Procedures | Used by SQL Server Profiler. To execute a SQL Server Profiler Extended Procedure against a local server through SQL Server Query Analyzer, use Windows NT Authentication. When using the shared memory network library, SQL Server does not support impersonation unless connected by using Windows NT Authentication. |
OLE Automation Procedures | Allows standard OLE automation objects to be used within a standard Transact-SQL batch. |
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.
Catalog Procedures | |
---|---|
sp_column_privileges | sp_special_columns |
sp_columns | sp_sproc_columns |
sp_databases | sp_statistics |
sp_fkeys | sp_stored_procedures |
sp_pkeys | sp_table_privileges |
sp_server_info | sp_tables |
Cursor Procedures | |
---|---|
sp_cursor_list | sp_describe_cursor_tables |
sp_describe_cursor | sp_describe_cursor_columns |
Web Assistant Procedures | |
---|---|
sp_dropwebtask | sp_makewebtask |
sp_enumcodepages | sp_runwebtask |
General Extended Procedures | |
---|---|
xp_cmdshell | xp_revokelogin |
xp_enumgroups | xp_sprintf |
xp_findnextmsg | xp_sqlinventory |
xp_grantlogin | xp_sscanf |
xp_loginconfig | xp_logevent |
xp_logininfo | |
xp_msver | |
xp_sqlmaint |
SQL Mail Extended Procedures | |
---|---|
xp_deletemail | xp_startmail |
xp_readmail | xp_stopmail |
xp_sendmail | xp_findnextmsg |
OLE Automation Extended Stored Procedures | ||
---|---|---|
sp_OACreate | sp_OAMethod | |
sp_OADestroy | sp_OASetProperty | |
sp_OAGetErrorInfo | sp_OAStop | |
sp_OAGetProperty | Object Hierarchy Syntax |
Users running SQL Server 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 a 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.