Skip to content

Commit

Permalink
Added documentation for PR #6777 (Query Store Set and Get functions s…
Browse files Browse the repository at this point in the history
…houldn't try to get data from model) (#9266)
  • Loading branch information
ReeceGoding authored Mar 9, 2024
1 parent 2d35be3 commit 524b099
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions public/Get-DbaDbQueryStoreOption.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ function Get-DbaDbQueryStoreOption {
.DESCRIPTION
Retrieves and returns the Query Store configuration for every database that has the Query Store feature enabled.
Due to SMO limitations, the model database is not checked.
.OUTPUTS
Microsoft.SqlServer.Management.Smo.QueryStoreOptions
Expand All @@ -17,7 +19,7 @@ function Get-DbaDbQueryStoreOption {
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance..
For MFA support, please use Connect-DbaInstance.
.PARAMETER Database
The database(s) to process - this list is auto-populated from the server. If unspecified, all databases will be processed.
Expand Down Expand Up @@ -68,6 +70,7 @@ function Get-DbaDbQueryStoreOption {
[switch]$EnableException
)
begin {
# We exclude model because SMO cannot tell if Query Store is enabled there
$ExcludeDatabase += 'master', 'tempdb', "model"
}
process {
Expand All @@ -78,7 +81,7 @@ function Get-DbaDbQueryStoreOption {
Stop-Function -Message "Failure" -Category ConnectionError -ErrorRecord $_ -Target $instance -Continue
}

# We have to exclude all the system databases since they cannot have the Query Store feature enabled
# We have to exclude system databases since they cannot have the Query Store feature enabled
$dbs = Get-DbaDatabase -SqlInstance $server -ExcludeDatabase $ExcludeDatabase -Database $Database | Where-Object IsAccessible

foreach ($db in $dbs) {
Expand Down Expand Up @@ -112,4 +115,4 @@ function Get-DbaDbQueryStoreOption {
}
}
}
}
}

0 comments on commit 524b099

Please sign in to comment.