Below is the list of some system stored procedure which are helpfull
sp_spaceused [table] - shows you space used by the table
sp_helpindex [table] - shows you index info (same info as sp_help)
sp_helpconstraint [table] - shows you primary/foreign key/defaults and other constraints *
sp_depends [obj] - shows dependencies of an object, for example:
sp_depends [sproc] - shows what tables etc are affected/used by this stored proc
sp_rename [obj] - for renaming database objects (tables, columns, indexes, etc.)
sp_tables - Shows you all the table name in the schema
sp_datatype_info - Shows you all the information for datatype
sp_pkeys [table] - Shows you list of primary key into a table
sp_fkeys [table] - gives the list of foreign key and te tables name in which they are used
sp_databases - gives the list of all the databases
This query will give us all the stored procedure name in to database
SELECT * FROM sys.procedures;
If you want to see system stored procedure then you can use below query.
SELECT * FROM sys.all_objects WHERE schema_id = 4;
No comments:
Post a Comment