Annotations
Published 07 October 2020
The annotations API can be used to add annotations to the top graph (timeline) for SQL Server instances, for example to record the time of a deployment.
Add-Annotation
You can add an annotation with a command similar to this:
Add-Annotation -Target $instance -Description "Deployment" -UtcDate Get-Date
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| Target | Instance | Yes | The SQLServer instance to target the annotation at |
| Description | string | No | A textual description; will form the title of the annotation unless Source is specified, where it will form an additional line of information |
| UtcDate | DateTime | Yes | The time in UTC to attach the annotation |
| Url | string | No | A URL to navigate the user to if the annotation is clicked |
| Source | string | No | The source of the annotation, such as Error or SQL Update |
| DatabaseName | string | No | Unused for now |
| SpecificInfo | string | No | Customises different types of annotations |
Valid Sources:
| Name | Description | ||
|---|---|---|---|
| Deployment | For annotating deployments to the SQL Server. Use SpecificInfo to specify what was deployed. | ||
| Error | For annotating errors. Use SpecificInfo to specify error. | ||
| Permissions Change | For annotating permissions changing on a SQL Server. | ||
| Configuration Change | For annotating configuration changes. Use SpecificInfo to indicate what configuration was configured. | ||
| SQL Update | For annotating SQL Updates. Use SpecificInfo to provide the version number updated. |
Get-Annotation
Get details about an annotation on a SQL Server instance at a given time.
$annotation = Get-Annotation -Target $instance -UtcDate $dateRemove-Annotation
Removes an annotation from a SQL Server instance at a given time.
Remove-Annotation -Target $instance -UtcDate $dateUpdate-Annotation
Updates an annotation on a SQL Server instance at a given time by overwriting the annotation with the newly provided details.
Takes the same arguments as Add-Annotation.









