This commit is contained in:
2024-02-28 09:39:11 +01:00
parent 48c2c9e659
commit 4f05fd7194
3 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
{
"id": "32fd4a4f-53d3-4bb1-aa70-ee59e64426c9",
"prefix": "query_store_enable",
"description": "",
"body": "DECLARE @tpl VARCHAR(444) = 'ALTER DATABASE @db@ SET QUERY_STORE = ON;'\r\n\r\nSELECT name, REPLACE(@tpl, '@db@', d.[name]) AS q, *\r\nFROM sys.databases d\r\nWHERE [d].[database_id]>4 --no system db's\r\nAND d.[is_read_only] = 0 --RW db's only\r\nAND d.[state] = 0 --online\r\n"
}