SQL Server 2000 DBCC statements use input parameters and return values. All DBCC statement parameters can accept Unicode and DBCS literal values.
Use DBCC result set output
Many DBCC commands can generate output in table format (using the with tableresults option ). This information can be loaded into the table for future use. The following shows an example script:
-- Create the table to accept the resultscreate table # tracestatus (traceflag int, status INT) -- execute the command, putting the results in the tableinsert into # tracestatus exec ('dbcc tracestatus (-1) with no_infomsgs ') -- display the resultsselect * from # tracestatusgo
Maintenance statement
DBCC dbreindex
DBCC dbrepair
DBCC indexdefrag
DBCC shrinkdatabase
DBCC shrinkfile
DBCC updateusage
Miscellaneous statements
DBCC dllname (free)
DBCC help
DBCC pintable
DBCC rowlock
DBCC traceoff
DBCC traceon
DBCC unpintable
Status statement
DBCC pintable
DBCC opentran
DBCC outputbuffer
DBCC proccache
DBCC showcontig
DBCC show_statistics
DBCC sqlperf
DBCC tracestatus
DBCC useroptions
Verification statement
DBCC checkalloc
DBCC checkcatalog
DBCC checkconstraints
DBCC checkdb
DBCC checkfilegroup
DBCC checkident
DBCC checktable
DBCC newalloc