diff --git a/samples/manage/sql-assessment-api/DisablingBuiltInChecks_sample.json b/samples/manage/sql-assessment-api/DisablingBuiltInChecks_sample.json index 24982831ff..c64dfddd60 100644 --- a/samples/manage/sql-assessment-api/DisablingBuiltInChecks_sample.json +++ b/samples/manage/sql-assessment-api/DisablingBuiltInChecks_sample.json @@ -9,4 +9,5 @@ "enabled": false } ] -} +} + diff --git a/samples/manage/sql-assessment-api/MakingCustomChecks_sample.json b/samples/manage/sql-assessment-api/MakingCustomChecks_sample.json index 732753f52e..f8605bde4b 100644 --- a/samples/manage/sql-assessment-api/MakingCustomChecks_sample.json +++ b/samples/manage/sql-assessment-api/MakingCustomChecks_sample.json @@ -58,3 +58,4 @@ ] } } + diff --git a/samples/manage/sql-assessment-api/QueryStoreCheck_fix.json b/samples/manage/sql-assessment-api/QueryStoreCheck_fix.json new file mode 100644 index 0000000000..28d980100b --- /dev/null +++ b/samples/manage/sql-assessment-api/QueryStoreCheck_fix.json @@ -0,0 +1,13 @@ +{ + "checks":[ + { + "id": "SqlServer.Database.QueryStoreOn", + "target":{ + "type": "Database", + "version": "[13.0,)", + "platform": "Windows", + "name": { "not": "/^(master|tempdb)$/" } + } + } + ] +} diff --git a/samples/manage/sql-assessment-api/README.md b/samples/manage/sql-assessment-api/README.md index 0d93c9dcf6..f334c5ab87 100644 --- a/samples/manage/sql-assessment-api/README.md +++ b/samples/manage/sql-assessment-api/README.md @@ -70,3 +70,13 @@ Demonstrates how to make a custom rule set containing two checks. The sample con ] } ``` + +## QueryStoreCheck_fix.json + +Overrides the default ruleset to fix the rule "Query Store should be on." Query Store appeared in SQL Server 2016 but the rule checks for it starting with SQL Server 2014. + +Here's an example of applying the fix to running the InvokeSqlAssessment cmdlet. + +```PowerShell +Get-SqlInstance -ServerInstance 'localhost' | Get-SqlDatabase | Invoke-SqlAssessment -configuration "C:\SQLAssessment\QueryStore_fix.json" +```