DBCC The Transact-SQL programming language provides DBCC statements that act as Database Console Commands for SQL Server 2005.

Database Console Command statements are grouped into the following categories.

Command category  Perform 
Maintenance
 Maintenance tasks on a database, index, or filegroup.
 
Miscellaneous
 Miscellaneous tasks such as enabling trace flags or removing a DLL from memory.
 
Informational
 Tasks that gather and display various types of information.
 
Validation
 Validation operations on a database, table, index, catalog, filegroup, or allocation of database pages.
 

DBCC commands take input parameters and return values. All DBCC command parameters can accept both Unicode and DBCS literals
CREATE TABLE #tracestatus (
   TraceFlag int,
   Status int
   )

-- Execute the command, putting the results in the table.
INSERT INTO #tracestatus
   EXEC ('DBCC TRACESTATUS (-1) WITH NO_INFOMSGS')

-- Display the results.
SELECT *
FROM #tracestatus
GO
DBCC CHECKALLOC
DBCC CHECKCATALOG
DBCC CHECKCONSTRAINT
DBCC CHECKDB
DBCC CHECKFILEGROUP
DBCC CHECKIDENT
DBCC CHECKTABLE
DBCC CLEANTABLE
DBCC CONCURRENCYVIOLATION
DBCC DBREINDEX
DBCC DBREPAIR
DBCC DLLNAME
DBCC DROPCLEANBUFFERS
DBCC FREEPROCACHE
DBCC FREESESSIONCACHE
DBCC FREESYSTEMCACHE
DBCC HELP
DBCC INDEXDEFRAG
DBCC INPUTBUFFER
DBCC OPENTRAN
DBCC OUTPUTBUFFER
DBCC PINTABLE
DBCC PROCCACHE
DBCC SHOW_STATISTICS
DBCC SHOWCONTIG
DBCC SHRINKDATABASE
DBCC SHRINKFILE
DBCC SQLPERF
DBCC TRACEOFF
DBCC TRACEON
DBCC TRACESTATUS
DBCC UNPINTABLE
DBCC UPDATEUSAGE
DBCC USEROPTIONS
DBCC
DBCC
DBCC
DBCC
DBCC
DBCC
DBCC
DBCC