Database Engine stored procedures
102 reference entries
- sp_bindsession
spbindsession binds or unbinds a session to other sessions in the same instance of the SQL Server Database Engine.
- sp_cycle_errorlog
spcycleerrorlog closes the current error log file and cycles the error log extension numbers just like a server restart.
- sp_dbmmonitordropmonitoring
spdbmmonitordropmonitoring stops and deletes the mirroring monitor job for all the databases on the server instance.
- sp_dbmmonitorhelpmonitoring
spdbmmonitorhelpmonitoring returns the current update period.
- sp_delete_backuphistory
Reduces the size of the backup and restore history tables by deleting the entries for backup sets older than the specified date.
- sp_describe_first_result_set
Returns the metadata for the first possible result set of the Transact-SQL batch.
- sp_describe_undeclared_parameters
Returns a result set that contains metadata about undeclared parameters in a Transact-SQL batch.
- sp_execute
spexecute executes a prepared Transact-SQL statement using a specified handle and optional parameter value.
- sp_executesql
parameterized dynamic SQL in a child batch scope
- sp_get_endpoint_certificate
Returns a public key of the certificate used for authentication on endpoint of specified type with certificate-based trust configured.
- sp_get_query_template
spgetquerytemplate returns the parameterized form of a query.
- sp_getbindtoken
spgetbindtoken returns a unique identifier for the transaction.
- sp_helpsort
sphelpsort Displays the sort order and character set for the instance of SQL Server.
- sp_monitor
spmonitor displays statistics about SQL Server.
- sp_prepare
Prepares a parameterized Transact-SQL statement and returns a statement handle for execution.
- sp_prepexec
spprepexec prepares and executes a parameterized Transact-SQL statement.
- sp_prepexecrpc
spprepexecrpc prepares and executes a parameterized stored procedure call specified using an RPC identifier.
- sp_set_session_context
spsetsessioncontext sets a key-value pair in the session context.
- sp_unprepare
Discards the execution plan created by the spprepare stored procedure.
- sys.sp_add_data_file_recover_suspect_db
Adds a data file to a filegroup when recovery can't complete on a database due to insufficient space on the file group (error 1105).
- sys.sp_add_log_file_recover_suspect_db
Adds a log file to a database when recovery can't complete on a database due to insufficient log space (error 9002).
- sys.sp_addextendedproc
Registers the name of a new extended stored procedure to SQL Server.
- sys.sp_addextendedproperty
Adds a new extended property to a database object.
- sys.sp_addmessage
Stores a new user-defined error message in an instance of the SQL Server Database Engine.
- sys.sp_addtype
spaddtype creates an alias data type.
- sys.sp_addumpdevice
Adds a backup device to an instance of SQL Server.
- sys.sp_altermessage
Alters the state of user-defined or system messages in an instance of the SQL Server Database Engine.
- sys.sp_attach_db
spattachdb attaches a database to a server.
- sys.sp_attach_single_file_db
spattachsinglefiledb attaches a database that's only one data file to the current server.
- sys.sp_autostats
Displays or changes AUTOUPDATESTATISTICS for an index, statistics object, a table, or an indexed view.
- sys.sp_bindefault
spbindefault binds a default to a column or to an alias data type.
- sys.sp_bindrule
spbindrule binds a rule to a column or to an alias data type.
- sys.sp_certify_removable
Verifies that a database is correctly configured for distribution on removable media and reports any problems to the user.
- sys.sp_clean_db_file_free_space
Removes residual information left on database pages in a database file, because of data modification routines in SQL Server.
- sys.sp_clean_db_free_space
Removes residual information left on database pages because of data modification routines in SQL Server.
- sys.sp_configure
spconfigure displays or changes global configuration settings for the current server.
- sys.sp_control_plan_guide
The spcontrolplanguide system stored procedure drops, enables, or disables a plan guide.
- sys.sp_create_plan_guide
spcreateplanguide creates a plan guide for associating query hints or actual query plans with queries in a database.
- sys.sp_create_plan_guide_from_handle
spcreateplanguidefromhandle creates one or more plan guides from a query plan in the plan cache.
- sys.sp_create_removable
spcreateremovable creates a removable media database.
- sys.sp_createstats
Calls the CREATE STATISTICS Transact-SQL statement to create single-column statistics on columns that aren't already the first column in a statistics object.
- sys.sp_datatype_info
spdatatypeinfo returns information about the data types supported by the current environment.
- sys.sp_db_increased_partitions
spdbincreasedpartitions enables or disables support for up to 15,000 partitions for the specified database.
- sys.sp_dbcmptlevel
spdbcmptlevel sets certain database behaviors to be compatible with the specified version of SQL Server.
- sys.sp_dbmmonitoraddmonitoring
spdbmmonitoraddmonitoring creates a database mirroring monitor job that periodically updates the mirroring status for every mirrored database on the server instance.
- sys.sp_dbmmonitorchangealert
spdbmmonitorchangealert adds or changes warning threshold for a specified mirroring performance metric.
- sys.sp_dbmmonitorchangemonitoring
spdbmmonitorchangemonitoring changes the value of a database mirroring monitoring parameter.
- sys.sp_dbmmonitordropalert
spdbmmonitordropalert drops the warning for a specified performance metric, by setting the threshold to NULL.
- sys.sp_dbmmonitorhelpalert
Returns information about warning thresholds on one or all of several key database mirroring monitor performance metrics.
- sys.sp_dbmmonitorresults
Returns status rows for a monitored database from the status table in which database mirroring monitoring history is stored.
- sys.sp_depends
spdepends displays information about database object dependencies.
- sys.sp_detach_db
Detaches a database that is currently not in use from a server instance and, optionally, runs UPDATE STATISTICS on all tables before detaching.
- sys.sp_dropdevice
Drops a database device or backup device from SQL Server instance, deleting the entry from master.dbo.sysdevices.
- sys.sp_dropextendedproc
spdropextendedproc drops an extended stored procedure.
- sys.sp_dropextendedproperty
spdropextendedproperty drops an existing extended property.
- sys.sp_dropmessage
Drops a specified user-defined error message from an instance of the Database Engine.
- sys.sp_droptype
spdroptype deletes an alias data type from systypes.
- sys.sp_flush_log
Flushes to disk the transaction log of the current database, hardening all previously committed delayed durable transactions.
- sys.sp_getapplock
spgetapplock places a lock on an application resource.
- sys.sp_help
Reports information about a database object (any object listed in the sys.sysobjects compatibility view), a user-defined data type, or a data type.
- sys.sp_helpconstraint
sphelpconstraint returns a list of all constraint types and their information.
- sys.sp_helpdb
sphelpdb reports information about a specified database or all databases.
- sys.sp_helpdevice
sphelpdevice reports information about SQL Server backup devices.
- sys.sp_helpextendedproc
Reports the currently defined extended stored procedures and the name of the dynamic-link library (DLL) to which the procedure (function) belongs.
- sys.sp_helpfile
sphelpfile returns the physical names and attributes of files associated with the current database.
- sys.sp_helpfilegroup
sphelpfilegroup returns the names and attributes of filegroups associated with the current database.
- sys.sp_helpindex
sphelpindex reports information about the indexes on a table or view.
- sys.sp_helplanguage
sphelplanguage Reports information about a particular alternative language or about all languages in the SQL Server Database Engine.
- sys.sp_helpserver
sphelpserver reports information about a particular remote or replication server, or about all servers of both types.
- sys.sp_helpstats
sphelpstats returns statistics information about columns and indexes on the specified table.
- sys.sp_helptext
Displays the definition of a user-defined rule, default, unencrypted Transact-SQL stored procedure, user-defined function, trigger, computed column, CHECK constraint, view, or system object.
- sys.sp_helptrigger
sphelptrigger returns the type or types of DML triggers defined on the specified table for the current database.
- sys.sp_indexoption
spindexoption sets locking option values for user-defined clustered and nonclustered indexes or tables with no clustered index.
- sys.sp_invalidate_textptr
spinvalidatetextptr invalidates the specified in-row text pointer, or all in-row text pointers, in the transaction.
- sys.sp_lock
splock reports information about locks.
- sys.sp_merge_xtp_checkpoint_files
Deprecated procedure listed in the Database Engine stored procedures index. Review the Microsoft reference before use.
- sys.sp_procoption
spprocoption sets or clears a stored procedure for automatic execution.
- sys.sp_readerrorlog
spreaderrorlog allows you to read the contents of the SQL Server or SQL Server Agent error log file and filter on keywords.
- sys.sp_recompile
Causes stored procedures, triggers, and user-defined functions to be recompiled the next time that they're run.
- sys.sp_refreshview
sprefreshview updates the metadata for the specified non-schema-bound view.
- sys.sp_releaseapplock
spreleaseapplock releases a lock on an application resource.
- sys.sp_rename
rename
- sys.sp_renamedb
sprenamedb changes the name of a database.
- sys.sp_resetstatus
spresetstatus resets the status of a suspect database.
- sys.sp_sequence_get_range
spsequencegetrange returns a range of sequence values from a sequence object.
- sys.sp_serveroption
spserveroption (Transact-SQL).
- sys.sp_setnetname
spsetnetname sets the network names in sys.servers to their actual network computer names for remote instances of SQL Server.
- sys.sp_settriggerorder
spsettriggerorder specifies the AFTER triggers that are fired first or last.
- sys.sp_spaceused
spspaceused displays the number of rows, disk space reserved, and disk space used by objects in the database.
- sys.sp_tableoption
sptableoption sets option values for user-defined tables.
- sys.sp_unbindefault
Unbinds, or removes, a default from a column or from an alias data type in the current database.
- sys.sp_unbindrule
Unbinds a rule from a column or an alias data type in the current database.
- sys.sp_updateextendedproperty
Updates the value of an existing extended property.
- sys.sp_updatestats
Runs UPDATE STATISTICS against all user-defined and internal tables in the current database.
- sys.sp_validname
Checks for valid SQL Server identifier names.
- sys.sp_who
Provides information about current users, sessions, and processes in an instance of the SQL Server.
- sys.sp_xtp_bind_db_resource_pool
Binds the specified In-Memory OLTP database to the specified resource pool.
- sys.sp_xtp_checkpoint_force_garbage_collection
Marks source files used in the merge operation with the log sequence number (LSN) after which they aren't needed and can be garbage collected.
- sys.sp_xtp_control_proc_exec_stats
Enables statistics collection for natively compiled stored procedures for the instance.
- sys.sp_xtp_control_query_exec_stats
Enables per query statistics collection for all or specific natively compiled stored procedures on an instance.
- sys.sp_xtp_force_gc
Manually release memory related to deleted rows of in-memory data that are eligible for garbage collection.
- sys.sp_xtp_unbind_db_resource_pool
Removes an existing binding between a database and a resource pool for purposes of tracking In-Memory OLTP memory usage.