DBCC HELP!!

SQL Server has many DBCC commands, administrators use them for maintenance, validation and to collect information about the database, for example, DBCC SHOW_STATISTICS displays statistics for a table.

But there is another interesting DBCC command, DBCC HELP. This command lists all the documented DBCC commands, and it also gives the syntax for a specific command. The following code returns all the available DBCC commands.

DBCC HELP ('?') 

The following code provides syntax for the command SHOW_STATISTICS. It could be useful, especially when the internet is not accessible to check for syntax.

DBCC HELP ('SHOW_STATISTICS')

This help statement provides syntax for SHOW_STATISTICS as below.

dbcc SHOW_STATISTICS
(
{ 'table_name' | 'view_name' }
, target
)
[ WITH
{
[ NO_INFOMSGS ]
< option > [ , n ]
}
]
< option > ::=
STAT_HEADER | DENSITY_VECTOR | HISTOGRAM

Leave a Reply

Your email address will not be published.