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 00000000..28d98010 --- /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 1285f808..f334c5ab 100644 --- a/samples/manage/sql-assessment-api/README.md +++ b/samples/manage/sql-assessment-api/README.md @@ -71,3 +71,12 @@ 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" +```