DBCC showfilestats--clears all elements from the procedure cache DBCC freeproccache--clear all buffers from the buffer pool DBCC dropcleanbuffers--FREE all unused cached DBCC from all caches Freesystemcache (' tempdb ')--sp_server_info view SQL Server information--information that is used to display SQL Server2008, including the database version number, the character set ordering method, and the maximum number of characters for the data table name. EXEC sp_server_info--sp_databases View database Information--for displaying all database information, including database name and data size. EXEC sp_databases--sp_monitor View system statistics EXEC sp_monitor-: Display statistics including CPU working time, input and output time, number of packets read or write Data--sp_helpdb view database information exec sp_helpdb--: Returns all database information in the current instance exec sp_helpdb ' AIS20141030141246 '--: Return information for Zhongyang database--sp_helpfile View database file information exec sp_ HelpFile--: View all data file properties of the current data exec sp_helpfile ' AIS20141030141246 '--: View properties of the data file Zhongyang_data--sp_ Helpfilegroup View filegroup Information EXEC sp_helpfilegroup--: Used to return the name and properties of the filegroup associated with the current database--sp_helpindex view index information exec sp_helpindex ' orders ' --: Returns the index information on the Orders table or view--sp_helpsort view sorting and character set information exec sp_helpsort--sp_helpstats view statistics for columns and indexes exec sp_helpstats ' orders ', ' Stats '--: Returns only statistics that are not associated with the index exec sp_helpstats ' orders ', ' all '--: Returns statistics for all indexes and statistics for the columns that created the statistics--SP_ HelpText Viewing object Content--used to return user-defined rules, defaults, stored procedures, functions, triggers, computed columns, check constraints, views, or system objects, but encrypted objectsThe content cannot be displayed. exec sp_helptext ' dbo.spgeninsertsql '--: Returns the contents of the stored procedure dbo.spgeninsertsql exec sp_helptext ' orders ', ' shopprice '-- : Returns the contents of the calculated column Shopprice of the Orders table--sp_help View object information exec sp_help--: Returns all objects in the current database exec sp_help ' orders '--: Returns all objects in the Orders table--sp_ Tables view table or view information exec sp_tables--: Returns all data table and view information in the current database exec sp_tables @table_type = ' table '--: Returns information about all data tables in the current database exec SP _tables ' orders '--: Returns information for the Orders table--sp_columns view column information exec sp_columns ' orders '--: Returns all column information for the Orders table exec sp_columns ' orders ', @column_name = ' Empid '--: Returns information for the Orders table empid column--sp_rename Modify the object name--used to change the name of the user-created object in the database, such as data tables, indexes, fields, Alias data type or CLR user-defined type exec sp_rename ' orders ', ' orders1 '--: Modify the Orders table table name to orders1--sp_renamedb Modify the database name exec sp_renamedb ' Zhongyang ', ' zhongyang1 '--: Modify the database Zhongyang name to zhongyang1--sp_helptrigger view trigger information exec sp_helptrigger ' orders '-- : Returns all DML trigger information in the Orders table exec sp_helptrigger ' orders ', ' Insert '/' Update '/' delete '--: Returns all insert triggers in the Orders table/update trigger/ Delete Trigger information--sp_who View user and process information-used to display information about the current user and process, including the system process ID, process status, login name, host name, and database being used. EXEC sp_who--: Displays information about all current users and processes exEC sp_who ' sa '--: Displays process information for the SA user--sp_lock view lock information exec sp_lock--: Returns information on all locks exec sp_lock 51--: Returns information about the lock of the database engine process ID (SPID) to 51--sp_ Fkeys View foreign key information exec sp_fkeys ' orders '--: Returns foreign key information for the Orders table--sp_pkeys View primary key information exec sp_pkeys ' orders '--: Returns the primary key information for the Orders table--sp_ Stored_procedures Viewing stored procedure information exec sp_stored_procedures--: Returning all stored procedure information exec sp_stored_procedures ' spgeninsertsql '-- : Returns the information for the stored procedure ' Spgeninsertsql '
SQL database View commands