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)