DBCC HELP (Transact-SQL)
Applies to:
SQL Server
Azure SQL Managed Instance
Returns syntax information for the specified DBCC command.
Transact-SQL syntax conventions
Syntax
DBCC HELP ( 'dbcc_statement' | @dbcc_statement_var | '?' )
[ WITH NO_INFOMSGS ]
Note
To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, see Previous versions documentation.
Arguments
dbcc_statement | @dbcc_statement_var
The name of the DBCC command for which to receive syntax information. Provide only the part of the DBCC command that follows DBCC, for example, CHECKDB
instead of DBCC CHECKDB
.
'?'
Returns all DBCC commands for which help is available.
WITH NO_INFOMSGS
Suppresses all informational messages that have severity levels from 0 through 10.
Result sets
DBCC HELP
returns a result set displaying the syntax for the specified DBCC command.
Permissions
Requires membership in the sysadmin fixed server role.
Examples
A. Use DBCC HELP with a variable
The following example returns syntax information for DBCC CHECKDB
:
DECLARE @dbcc_stmt sysname;
SET @dbcc_stmt = 'CHECKDB';
DBCC HELP (@dbcc_stmt);
GO
B. Use DBCC HELP with the '?' option
The following example returns all DBCC statements for which help is available.
DBCC HELP ('?');
GO