SQL Built-In Stored Procedures
Overview
Use built-in stored procedures to perform administrative and informational activities in Microsoft® SQL Server™.
Details
Here are some examples of built-in stored procedures to get you started.
| Stored Procedure | Syntax |
|---|---|
|
sp_depends - Displays information about database object dependencies (for example, the views and procedures that depend on a table or view, and the tables and views that are depended on by the view or procedure). References to objects outside the current database are not reported. |
sp_depends [ @objname = ] 'object' |
|
sp_help - Reports information about a database object (any object listed in the sysobjects table), a user-defined data type, or a data type supplied by Microsoft® SQL Server™. |
sp_help [ [ @objname = ] name ]. |
|
sp_datatype_info - Returns information about the data types supported by the current environment. |
sp_datatype_info [ [ @data_type = ] data_type ] sp_datatype_info |
|
sp_updatestats - Runs UPDATE STATISTICS against all user-defined tables in the current database. |
sp_updatestats [[@resample =] 'resample'] |
|
sp_who - Provides information about current Microsoft® SQL Server™ users and processes. The information returned can be filtered to return only those processes that are not idle. |
sp_who [[@login_name =] 'login'] |
|
sp_helptext - Displays the definition of a user-defined rule, default, unencrypted Transact-SQL stored procedure, user-defined Transact-SQL function, trigger, computed column, CHECK constraint, view, or system object such as a system stored procedure. |
sp_helptext [ [ @objname = ] name ]. |
