---
title: "Get-DbaDbccHelp"
description: "Retrieves syntax help and parameter information for DBCC commands"
url: "https://dbatools.io/Get-DbaDbccHelp/"
availability: "Windows, Linux, macOS"
tags: ["DBCC"]
author: "Patrick Flynn (@sqllensman)"
source: "https://github.com/dataplat/dbatools/blob/master/public/Get-DbaDbccHelp.ps1"
last_updated: "2024-01-01"
---

# Get-DbaDbccHelp

## Synopsis

Retrieves syntax help and parameter information for DBCC commands

## Description

Executes DBCC HELP against SQL Server to display syntax, parameters, and usage information for Database Console Commands. This saves you from having to look up DBCC command syntax in documentation, especially for complex commands like CHECKDB, CHECKTABLE, or SHRINKFILE. Supports both documented and undocumented DBCC commands when used with the IncludeUndocumented parameter.  
  
Read more:  
    - https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-help-transact-sql

## Syntax

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

```

## Examples

### Example 1: Runs the command DBCC HELP(FREESYSTEMCACHE) WITH NO_INFOMSGS against the SQLInstance SQL Server instance

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

### Example 2: Sets Trace Flag 2588 on for the session and then runs the command DBCC HELP(WritePage) WITH NO_INFOMSGS...

```powershell
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.

| Property | Value |
| --- | --- |
| 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.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value |  |

##### -Statement

Specifies the DBCC command name to get syntax help for. Provide only the command portion after "DBCC" (e.g., CHECKDB, CHECKTABLE, SHRINKFILE).  
Use this when you need to verify command syntax before running maintenance operations or troubleshooting database issues.  
Common commands include CHECKDB for database integrity, SHRINKFILE for file management, or FREEPROCCACHE for memory management.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value |  |

##### -IncludeUndocumented

Enables access to help for undocumented DBCC commands by setting trace flag 2588 for the session.  
Use this when troubleshooting advanced scenarios that require undocumented commands like WRITEPAGE or PAGE.  
Only works on SQL Server 2005 and higher, and should be used with caution as undocumented commands can affect system stability.

| Property | Value |
| --- | --- |
| 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.

| Property | Value |
| --- | --- |
| Alias |  |
| Required | False |
| Pipeline | false |
| Default Value | False |

## Outputs

**PSCustomObject**

Returns one object per SQL Server instance containing the DBCC help information.

**Properties:**

- Operation: The DBCC command name specified in the Statement parameter (e.g., "CHECKDB", "SHRINKFILE")
- Cmd: The complete DBCC command executed against SQL Server (e.g., "DBCC HELP(CHECKDB)")
- Output: The raw output from the DBCC HELP command, containing the syntax help and parameter information. This is typically a DataTable or collection of results rows with parameter details.

---

Part of [dbatools](https://dbatools.io/), a free and open source PowerShell module for SQL Server administration. Full command index: https://dbatools.io/commands/
