You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/manage/sql-assessment-api/README.md
+23-20Lines changed: 23 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,28 +37,31 @@ Demonstrates how to make a custom rule set containing two checks. The sample con
37
37
`Probes`, in fact, describe how and where get required data to perform a check. For this, you can use T-SQL queries as well as methods from assemblies. The probe below uses a T-SQL query.
38
38
```
39
39
"probes":{
40
-
"DatabaseConfiguration": [
40
+
"DatabaseConfiguration": [ //Probe name that is used to reference the probe from a check.
41
+
//Probe can have a few implementations that will be used for different targets.
42
+
//This probe has two implementations for different version of SQL Server.
41
43
{
42
-
"type": "SQL",
43
-
"target": {
44
-
"type": "Database",
45
-
"version": "(,12.0)",
46
-
"platform": "Windows"
44
+
"type": "SQL", //Probe uses a T-SQL query to get the required data
45
+
"target": {
46
+
"type": "Database", //Targets at database
47
+
"version": "(,12.0)", //This implementation is for SQL Server before 2014
48
+
"platform": "Windows" //Targets at SQL on Windows
49
+
},
50
+
"implementation": { //Implementation object with a T-SQL query.
51
+
//sys.databases of SQL Server before 2014 doesn't have the field is_query_store_on so we replace it with 0.
52
+
"query": "SELECT db.[is_auto_create_stats_on] AS is_auto_create_stats_on, db.[is_auto_update_stats_on] AS is_auto_update_stats_on, 0 AS is_query_store_on FROM sys.databases AS db WHERE db.[name]='@DatabaseName'"
53
+
}
47
54
},
48
-
"implementation": {
49
-
"query": "SELECT db.[is_auto_create_stats_on] AS is_auto_create_stats_on, db.[is_auto_update_stats_on] AS is_auto_update_stats_on, 0 AS is_query_store_on FROM sys.databases AS db WHERE db.[name]='@DatabaseName'"
50
-
}
51
-
},
52
-
{
53
-
"type": "SQL",
54
-
"target": {
55
-
"type": "Database",
56
-
"version": "[12.0,)",
57
-
"platform": "Windows"
58
-
},
59
-
"implementation": {
60
-
"query": "SELECT db.[is_auto_create_stats_on] AS is_auto_create_stats_on, db.[is_auto_update_stats_on] AS is_auto_update_stats_on, db.[is_query_store_on] AS is_query_store_on FROM sys.databases AS db WHERE db.[name]='@DatabaseName'"
61
-
}
55
+
{ //Second implementation
56
+
"type": "SQL",
57
+
"target": {
58
+
"type": "Database",
59
+
"version": "[12.0,)", //This implementation is for SQL Server 2014 and up.
60
+
"platform": "Windows"
61
+
},
62
+
"implementation": { //Query of the second implementation.
63
+
"query": "SELECT db.[is_auto_create_stats_on] AS is_auto_create_stats_on, db.[is_auto_update_stats_on] AS is_auto_update_stats_on, db.[is_query_store_on] AS is_query_store_on FROM sys.databases AS db WHERE db.[name]='@DatabaseName'"
0 commit comments