commands

^

Get-DbaDbccHelp

Author Patrick Flynn (@sqllensman)
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Get-DbaDbccHelp on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaDbccHelp.

Synopsis

Execution of Database Console Command DBCC HELP

Description

Returns the results of DBCC HELP

Read more:
- https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-help-transact-sql

Syntax

Get-DbaDbccHelp
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Statement] <String>]
    [-IncludeUndocumented]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaDbccHelp -SqlInstance SQLInstance -Statement FREESYSTEMCACHE -Verbose | Format-List

Runs the command DBCC HELP(FREESYSTEMCACHE) WITH NO_INFOMSGS against the SQLInstance SQL Server instance.

Example: 2
PS C:\> Get-DbaDbccHelp -SqlInstance SQLInstance -Statement WritePage -IncludeUndocumented | Format-List

Sets Trace Flag 2588 on for the session and then runs the command DBCC HELP(WritePage) WITH NO_INFOMSGS against the SQLInstance SQL Server instance.

Required Parameters

-SqlInstance

The target SQL Server instance or instances.

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-SqlCredential

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.

Alias
Required False
Pipeline false
Default Value
-Statement

Is 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.

Alias
Required False
Pipeline false
Default Value
-IncludeUndocumented

Allows getting help for undocumented DBCC commands. Requires Traceflag 2588
This only works for SQL Server 2005 or Higher

Alias
Required False
Pipeline false
Default Value False
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False