P. 1
37606200 SQL Server 2005 Handout by Cognizant

37606200 SQL Server 2005 Handout by Cognizant

|Views: 31|Likes:
Published by Sumeetha Ponnam

More info:

Published by: Sumeetha Ponnam on Dec 29, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





T-SQL provides DBCC statements that act as Database Console Commands for SQL Server
2005.They are grouped into the following categories:

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

Some useful DBCC commands are as follows:

DBCC SHRINKDATABASE: Shrinks the size of the data files in the specified

DBCC SHRINKFILE: Shrinks the size of the specified data file or log file for the
related database.

DBCC INDEXDEFRAG: Defragments indexes of the specified table or view.

DBCC DBREINDEX: Rebuilds one or more indexes for a table in the specified

DBCC CLEANTABLE: Reclaims space for dropped variable length columns and text


DBCC CHECKDB: Checks the allocation, structural, and logical integrity of all the
objects in the specified database.

DBCC SHOW_STATISTICS: Displays the current distribution statistics for the
specified target on the specified table.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->