1, Database:
(1) sp_helpdb: Reports information about a specified database or all databases.
Example: sp_helpdb--Display all database information (name, size, etc.)
Example: sp_helpdb Recruitment--Display recruitment database information (name, size, etc.)
(2) Sp_renamedb: Change the name of the database.
Example: Sp_renamedb ' pubs ', ' pub '--renaming a database named pubs to pub
(3) sp_dboption: Display or change database options. You cannot use sp_dboption on the master or tempdb database.
Example: sp_dboption ' recruitment ', ' Read Only ', ' TRUE '--Set the recruitment database to read only
2, table
(1)sp_help: Finds objects in the current database.
Cases:sp_helpEmployee--Displays the structure of the employee table
(2) Sp_rename: Changes the name of a user-created object (such as a table, column, or user-defined data type) in the current database.
Example: sp_rename ' employee ', ' employ '
3, user-defined data types
(1) sp_addtype: Create a user-defined data type.
Example: sp_addtype birthday, datetime, ' NULL '
--created a user-defined data type named Birthday (DateTime based) that allows null values for the data type
(2) Sp_droptype: Delete user-defined data types.
Example: Sp_droptype ' birthday '--delete a user-defined data type birthday
(3)sp_help: View user-defined data types
Cases:sp_helpBirthday--View information for user-defined data types birthday
4, Rules
(1) Sp_bindrule: Binds a rule to a column or user-defined data type.
Example: Sp_bindrule rultype, ' titles.type '--binding the rule Rultype to the Type column of the Titles table
(2) Sp_unbindrule: Unbind a rule from a column or user-defined data type in the current database.
Example: Sp_unbindrule ' Titles.type '--unbind a rule from a Type column in a tiltes table
(3) Sp_helptext: View the details of the rule.
Example: Sp_helptext rultype--View details of a rule rultype
5, default
(1) Sp_bindefault: Binds the default value to a column or user-defined data type.
(2) Sp_unbindefault: Removes (deletes) the default value bindings for a column or user-defined data type in the current database.
(3) Sp_helptext: View the default value information.
6, Index
Sp_helpindex: Reports information about indexes on a table or view.
Example: Sp_helpindex employee--View index information in employee table
7, Views
Sp_helptext: Viewing the view text
8, stored Procedures
sp_helptext: viewing stored procedure text
9, triggers
(1)sp_help< trigger name;: To see if the specified trigger exists
(2) Sp_helptrigger: Returns the trigger type for the current database defined in the specified table.
Ten, other
sp_help: Reports information about database objects, user-defined data types, or data types.
Sp_helptext: Displays the text of a rule, default value, unencrypted stored procedure, user-defined function, trigger, or view.
sp_rename: Changes the name of a user-created object (such as a table, column, or user-defined data type) in the current database.
SQL Server Database SP Command Xiang Solution