SQL Server Internal parameter usage details (stored procedure)

Source: Internet
Author: User

exec sp_help; Returns all stored procedures in the current database.
The EXEC sp_help datebase.dbo.table name returns all objects in the current table. such as field names. This hanging
EXEC sp_helpfile returns the physical name and properties of the current database file. View all database file properties for the current data
EXEC sp_helpfile ' folder name ' To view the properties of the database file Northwind_data
exec sp_helpindex [table name] Returns all index information in the table
Sp_helptext Viewing object content information
Sp_helptrigger Viewing trigger information
Sp_helptrigger Products Returns all DML (redaction) trigger information in the table
Sp_helptrigger products, ' Insert ' returns information for all insert triggers under the Product table
sp_who display information for all current users and processes
sp_who SA displays process information for the current user of the SA
Sp_columns Viewing column information
@table_name the name of the table or view that returns directory information
@table_owner object owner of a table or view that returns directory information
@table_qualifier the name of a table or view qualifier
@column_name a separate column that can be used whenever a column of a directory
Included: Exec Sp_columms produces, @column_name =productname; Returns information for column fame "product name" in the product table
Sp_databases used to display database information including database name and database size the stored procedure has no parameters
Sp_fkeys Viewing foreign key information
@pktable_name the name of the table with the primary key to return directory information
Name of the owner of the @pktable_owner table (with primary key), used to return directory information
The name of the primary key qualifier for the @pktable_qualifier strap
@fktable_name the name of the foreign key for the bracelet used to return directory information
@fktable_owner the name of the owner of the strap foreign key used to return catalog information
Name of the foreign key qualifier for the @fktable_qualifier strap

Sp_pkeys Viewing primary key information
@table_name
@table_owner
@table_qualifier

Sp_server_info Viewing SQL Server information

Sp_tables viewing table or view information
@table_name table used to return directory information
@table_owner the owner of the table used to return directory information
@table_qualifier the name of the table qualifier
@table_type a comma-separated list of values that provide table information about all the table types that are made
@fUsePattern determines whether an underscore, a percent or square bracket, is interpreted as a wildcard character
Example:
exec sp_tables @table_type = "' dbo. Login ' "

Sp_stroed_procedures Viewing stored procedure information
@sp_name the name of the procedure used to return directory information
@sp_owner the schema that the procedure belongs to
@qualifier the name of the procedure qualifier
@fUsePattern determines whether an underscore, a percent or square bracket, is interpreted as a wildcard character

CREATE PROCEDURE proc_2
@return_var int Output
As
Begin
Select @return_var =sum (LoginId) from praise
End
Go

DECLARE @acept_var int
EXEC proc_2 @acept_var output
Print @acept_var
Go

CREATE PROCEDURE Proc_3
As
Begin
DECLARE @return_var1 int
Select @return_var1 =sum (LoginId) from praise
Return @return_var1
End
Go

DECLARE @varparmer int
EXEC @varparmer =proc_3
Print @varparmer
Go

CREATE PROCEDURE #proc_4
As
Begin
DECLARE @return_var1 int
Select @return_var1 =sum (LoginId) from praise
Return @return_var1
End
Go

DECLARE @varparmer int
exec @varparmer = #proc_4
Print @varparmer
Go

SQL Server Internal parameter usage details (stored procedure)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.