@@ -2320,177 +2320,141 @@ AS
2320
2320
2321
2321
IF @Debug IN (1 , 2 ) RAISERROR (' Generating default configuration values' , 0 , 1 ) WITH NOWAIT ;
2322
2322
2323
- INSERT INTO #ConfigurationDefaults
2324
- VALUES ( ' access check cache bucket count' , 0 , 1001 );
2325
- INSERT INTO #ConfigurationDefaults
2326
- VALUES ( ' access check cache quota' , 0 , 1002 );
2327
- INSERT INTO #ConfigurationDefaults
2328
- VALUES ( ' Ad Hoc Distributed Queries' , 0 , 1003 );
2329
- INSERT INTO #ConfigurationDefaults
2330
- VALUES ( ' affinity I/O mask' , 0 , 1004 );
2331
- INSERT INTO #ConfigurationDefaults
2332
- VALUES ( ' affinity mask' , 0 , 1005 );
2333
- INSERT INTO #ConfigurationDefaults
2334
- VALUES ( ' affinity64 mask' , 0 , 1066 );
2335
- INSERT INTO #ConfigurationDefaults
2336
- VALUES ( ' affinity64 I/O mask' , 0 , 1067 );
2337
- INSERT INTO #ConfigurationDefaults
2338
- VALUES ( ' Agent XPs' , 0 , 1071 );
2339
- INSERT INTO #ConfigurationDefaults
2340
- VALUES ( ' allow updates' , 0 , 1007 );
2341
- INSERT INTO #ConfigurationDefaults
2342
- VALUES ( ' awe enabled' , 0 , 1008 );
2343
- INSERT INTO #ConfigurationDefaults
2344
- VALUES ( ' backup checksum default' , 0 , 1070 );
2345
- INSERT INTO #ConfigurationDefaults
2346
- VALUES ( ' backup compression default' , 0 , 1073 );
2347
- INSERT INTO #ConfigurationDefaults
2348
- VALUES ( ' blocked process threshold' , 0 , 1009 );
2349
- INSERT INTO #ConfigurationDefaults
2350
- VALUES ( ' blocked process threshold (s)' , 0 , 1009 );
2351
- INSERT INTO #ConfigurationDefaults
2352
- VALUES ( ' c2 audit mode' , 0 , 1010 );
2353
- INSERT INTO #ConfigurationDefaults
2354
- VALUES ( ' clr enabled' , 0 , 1011 );
2355
- INSERT INTO #ConfigurationDefaults
2356
- VALUES ( ' common criteria compliance enabled' , 0 , 1074 );
2357
- INSERT INTO #ConfigurationDefaults
2358
- VALUES ( ' contained database authentication' , 0 , 1068 );
2359
- INSERT INTO #ConfigurationDefaults
2360
- VALUES ( ' cost threshold for parallelism' , 5 , 1012 );
2361
- INSERT INTO #ConfigurationDefaults
2362
- VALUES ( ' cross db ownership chaining' , 0 , 1013 );
2363
- INSERT INTO #ConfigurationDefaults
2364
- VALUES ( ' cursor threshold' , - 1 , 1014 );
2365
- INSERT INTO #ConfigurationDefaults
2366
- VALUES ( ' Database Mail XPs' , 0 , 1072 );
2367
- INSERT INTO #ConfigurationDefaults
2368
- VALUES ( ' default full-text language' , 1033 , 1016 );
2369
- INSERT INTO #ConfigurationDefaults
2370
- VALUES ( ' default language' , 0 , 1017 );
2371
- INSERT INTO #ConfigurationDefaults
2372
- VALUES ( ' default trace enabled' , 1 , 1018 );
2373
- INSERT INTO #ConfigurationDefaults
2374
- VALUES ( ' disallow results from triggers' , 0 , 1019 );
2375
- INSERT INTO #ConfigurationDefaults
2376
- VALUES ( ' EKM provider enabled' , 0 , 1075 );
2377
- INSERT INTO #ConfigurationDefaults
2378
- VALUES ( ' filestream access level' , 0 , 1076 );
2379
- INSERT INTO #ConfigurationDefaults
2380
- VALUES ( ' fill factor (%)' , 0 , 1020 );
2381
- INSERT INTO #ConfigurationDefaults
2382
- VALUES ( ' ft crawl bandwidth (max)' , 100 , 1021 );
2383
- INSERT INTO #ConfigurationDefaults
2384
- VALUES ( ' ft crawl bandwidth (min)' , 0 , 1022 );
2385
- INSERT INTO #ConfigurationDefaults
2386
- VALUES ( ' ft notify bandwidth (max)' , 100 , 1023 );
2387
- INSERT INTO #ConfigurationDefaults
2388
- VALUES ( ' ft notify bandwidth (min)' , 0 , 1024 );
2389
- INSERT INTO #ConfigurationDefaults
2390
- VALUES ( ' index create memory (KB)' , 0 , 1025 );
2391
- INSERT INTO #ConfigurationDefaults
2392
- VALUES ( ' in-doubt xact resolution' , 0 , 1026 );
2393
- INSERT INTO #ConfigurationDefaults
2394
- VALUES ( ' lightweight pooling' , 0 , 1027 );
2395
- INSERT INTO #ConfigurationDefaults
2396
- VALUES ( ' locks' , 0 , 1028 );
2397
- INSERT INTO #ConfigurationDefaults
2398
- VALUES ( ' max degree of parallelism' , 0 , 1029 );
2399
- INSERT INTO #ConfigurationDefaults
2400
- VALUES ( ' max full-text crawl range' , 4 , 1030 );
2401
- INSERT INTO #ConfigurationDefaults
2402
- VALUES ( ' max server memory (MB)' , 2147483647 , 1031 );
2403
- INSERT INTO #ConfigurationDefaults
2404
- VALUES ( ' max text repl size (B)' , 65536 , 1032 );
2405
- INSERT INTO #ConfigurationDefaults
2406
- VALUES ( ' max worker threads' , 0 , 1033 );
2407
- INSERT INTO #ConfigurationDefaults
2408
- VALUES ( ' media retention' , 0 , 1034 );
2409
- INSERT INTO #ConfigurationDefaults
2410
- VALUES ( ' min memory per query (KB)' , 1024 , 1035 );
2411
- /* Accepting both 0 and 16 below because both have been seen in the wild as defaults. */
2412
- IF EXISTS ( SELECT *
2413
- FROM sys .configurations
2414
- WHERE name = ' min server memory (MB)'
2415
- AND value_in_use IN ( 0 , 16 ) )
2416
- INSERT INTO #ConfigurationDefaults
2417
- SELECT ' min server memory (MB)' ,
2418
- CAST (value_in_use AS BIGINT ), 1036
2419
- FROM sys .configurations
2420
- WHERE name = ' min server memory (MB)' ;
2421
- ELSE
2422
- INSERT INTO #ConfigurationDefaults
2423
- VALUES ( ' min server memory (MB)' , 0 , 1036 );
2424
- INSERT INTO #ConfigurationDefaults
2425
- VALUES ( ' nested triggers' , 1 , 1037 );
2426
- INSERT INTO #ConfigurationDefaults
2427
- VALUES ( ' network packet size (B)' , 4096 , 1038 );
2428
- INSERT INTO #ConfigurationDefaults
2429
- VALUES ( ' Ole Automation Procedures' , 0 , 1039 );
2430
- INSERT INTO #ConfigurationDefaults
2431
- VALUES ( ' open objects' , 0 , 1040 );
2432
- INSERT INTO #ConfigurationDefaults
2433
- VALUES ( ' optimize for ad hoc workloads' , 0 , 1041 );
2434
- INSERT INTO #ConfigurationDefaults
2435
- VALUES ( ' PH timeout (s)' , 60 , 1042 );
2436
- INSERT INTO #ConfigurationDefaults
2437
- VALUES ( ' precompute rank' , 0 , 1043 );
2438
- INSERT INTO #ConfigurationDefaults
2439
- VALUES ( ' priority boost' , 0 , 1044 );
2440
- INSERT INTO #ConfigurationDefaults
2441
- VALUES ( ' query governor cost limit' , 0 , 1045 );
2442
- INSERT INTO #ConfigurationDefaults
2443
- VALUES ( ' query wait (s)' , - 1 , 1046 );
2444
- INSERT INTO #ConfigurationDefaults
2445
- VALUES ( ' recovery interval (min)' , 0 , 1047 );
2446
- INSERT INTO #ConfigurationDefaults
2447
- VALUES ( ' remote access' , 1 , 1048 );
2448
- INSERT INTO #ConfigurationDefaults
2449
- VALUES ( ' remote admin connections' , 0 , 1049 );
2450
- /* SQL Server 2012 changes a configuration default */
2451
- IF @@VERSION LIKE ' %Microsoft SQL Server 2005%'
2452
- OR @@VERSION LIKE ' %Microsoft SQL Server 2008%'
2453
- BEGIN
2454
- INSERT INTO #ConfigurationDefaults
2455
- VALUES ( ' remote login timeout (s)' , 20 , 1069 );
2456
- END ;
2323
+ INSERT INTO #ConfigurationDefaults
2324
+ VALUES
2325
+ ( ' access check cache bucket count' , 0 , 1001 ),
2326
+ ( ' access check cache quota' , 0 , 1002 ),
2327
+ ( ' Ad Hoc Distributed Queries' , 0 , 1003 ),
2328
+ ( ' affinity I/O mask' , 0 , 1004 ),
2329
+ ( ' affinity mask' , 0 , 1005 ),
2330
+ ( ' affinity64 mask' , 0 , 1066 ),
2331
+ ( ' affinity64 I/O mask' , 0 , 1067 ),
2332
+ ( ' Agent XPs' , 0 , 1071 ),
2333
+ ( ' allow updates' , 0 , 1007 ),
2334
+ ( ' awe enabled' , 0 , 1008 ),
2335
+ ( ' backup checksum default' , 0 , 1070 ),
2336
+ ( ' backup compression default' , 0 , 1073 ),
2337
+ ( ' blocked process threshold' , 0 , 1009 ),
2338
+ ( ' blocked process threshold (s)' , 0 , 1009 ),
2339
+ ( ' c2 audit mode' , 0 , 1010 ),
2340
+ ( ' clr enabled' , 0 , 1011 ),
2341
+ ( ' common criteria compliance enabled' , 0 , 1074 ),
2342
+ ( ' contained database authentication' , 0 , 1068 ),
2343
+ ( ' cost threshold for parallelism' , 5 , 1012 ),
2344
+ ( ' cross db ownership chaining' , 0 , 1013 ),
2345
+ ( ' cursor threshold' , - 1 , 1014 ),
2346
+ ( ' Database Mail XPs' , 0 , 1072 ),
2347
+ ( ' default full-text language' , 1033 , 1016 ),
2348
+ ( ' default language' , 0 , 1017 ),
2349
+ ( ' default trace enabled' , 1 , 1018 ),
2350
+ ( ' disallow results from triggers' , 0 , 1019 ),
2351
+ ( ' EKM provider enabled' , 0 , 1075 ),
2352
+ ( ' filestream access level' , 0 , 1076 ),
2353
+ ( ' fill factor (%)' , 0 , 1020 ),
2354
+ ( ' ft crawl bandwidth (max)' , 100 , 1021 ),
2355
+ ( ' ft crawl bandwidth (min)' , 0 , 1022 ),
2356
+ ( ' ft notify bandwidth (max)' , 100 , 1023 ),
2357
+ ( ' ft notify bandwidth (min)' , 0 , 1024 ),
2358
+ ( ' index create memory (KB)' , 0 , 1025 ),
2359
+ ( ' in-doubt xact resolution' , 0 , 1026 ),
2360
+ ( ' lightweight pooling' , 0 , 1027 ),
2361
+ ( ' locks' , 0 , 1028 ),
2362
+ ( ' max degree of parallelism' , 0 , 1029 ),
2363
+ ( ' max full-text crawl range' , 4 , 1030 ),
2364
+ ( ' max server memory (MB)' , 2147483647 , 1031 ),
2365
+ ( ' max text repl size (B)' , 65536 , 1032 ),
2366
+ ( ' max worker threads' , 0 , 1033 ),
2367
+ ( ' media retention' , 0 , 1034 ),
2368
+ ( ' min memory per query (KB)' , 1024 , 1035 ),
2369
+ ( ' nested triggers' , 1 , 1037 ),
2370
+ ( ' network packet size (B)' , 4096 , 1038 ),
2371
+ ( ' Ole Automation Procedures' , 0 , 1039 ),
2372
+ ( ' open objects' , 0 , 1040 ),
2373
+ ( ' optimize for ad hoc workloads' , 0 , 1041 ),
2374
+ ( ' PH timeout (s)' , 60 , 1042 ),
2375
+ ( ' precompute rank' , 0 , 1043 ),
2376
+ ( ' priority boost' , 0 , 1044 ),
2377
+ ( ' query governor cost limit' , 0 , 1045 ),
2378
+ ( ' query wait (s)' , - 1 , 1046 ),
2379
+ ( ' recovery interval (min)' , 0 , 1047 ),
2380
+ ( ' remote access' , 1 , 1048 ),
2381
+ ( ' remote admin connections' , 0 , 1049 ),
2382
+ ( ' remote login timeout (s)' , CASE
2383
+ WHEN @@VERSION LIKE ' %Microsoft SQL Server 2005%'
2384
+ OR @@VERSION LIKE ' %Microsoft SQL Server 2008%' THEN 20
2385
+ ELSE 10
2386
+ END , 1069 ),
2387
+ ( ' remote proc trans' , 0 , 1050 ),
2388
+ ( ' remote query timeout (s)' , 600 , 1051 ),
2389
+ ( ' Replication XPs' , 0 , 1052 ),
2390
+ ( ' RPC parameter data validation' , 0 , 1053 ),
2391
+ ( ' scan for startup procs' , 0 , 1054 ),
2392
+ ( ' server trigger recursion' , 1 , 1055 ),
2393
+ ( ' set working set size' , 0 , 1056 ),
2394
+ ( ' show advanced options' , 0 , 1057 ),
2395
+ ( ' SMO and DMO XPs' , 1 , 1058 ),
2396
+ ( ' SQL Mail XPs' , 0 , 1059 ),
2397
+ ( ' transform noise words' , 0 , 1060 ),
2398
+ ( ' two digit year cutoff' , 2049 , 1061 ),
2399
+ ( ' user connections' , 0 , 1062 ),
2400
+ ( ' user options' , 0 , 1063 ),
2401
+ ( ' Web Assistant Procedures' , 0 , 1064 ),
2402
+ ( ' xp_cmdshell' , 0 , 1065 ),
2403
+ ( ' automatic soft-NUMA disabled' , 0 , 269 ),
2404
+ ( ' external scripts enabled' , 0 , 269 ),
2405
+ ( ' clr strict security' , 1 , 269 ),
2406
+ ( ' column encryption enclave type' , 0 , 269 ),
2407
+ ( ' tempdb metadata memory-optimized' , 0 , 269 ),
2408
+ ( ' ADR cleaner retry timeout (min)' , 15 , 269 ),
2409
+ ( ' ADR Preallocation Factor' , 4 , 269 ),
2410
+ ( ' version high part of SQL Server' , 1114112 , 269 ),
2411
+ ( ' version low part of SQL Server' , 52428803 , 269 ),
2412
+ ( ' Data processed daily limit in TB' , 2147483647 , 269 ),
2413
+ ( ' Data processed weekly limit in TB' , 2147483647 , 269 ),
2414
+ ( ' Data processed monthly limit in TB' , 2147483647 , 269 ),
2415
+ ( ' ADR Cleaner Thread Count' , 1 , 269 ),
2416
+ ( ' hardware offload enabled' , 0 , 269 ),
2417
+ ( ' hardware offload config' , 0 , 269 ),
2418
+ ( ' hardware offload mode' , 0 , 269 ),
2419
+ ( ' backup compression algorithm' , 0 , 269 ),
2420
+ ( ' ADR cleaner lock timeout (s)' , 5 , 269 ),
2421
+ ( ' SLOG memory quota (%)' , 75 , 269 ),
2422
+ ( ' max RPC request params (KB)' , 0 , 269 ),
2423
+ ( ' max UCS send boxcars' , 256 , 269 ),
2424
+ ( ' availability group commit time (ms)' , 0 , 269 ),
2425
+ ( ' tiered memory enabled' , 0 , 269 ),
2426
+ ( ' max server tiered memory (MB)' , 2147483647 , 269 ),
2427
+ ( ' hadoop connectivity' , 0 , 269 ),
2428
+ ( ' polybase network encryption' , 1 , 269 ),
2429
+ ( ' remote data archive' , 0 , 269 ),
2430
+ ( ' allow polybase export' , 0 , 269 ),
2431
+ ( ' allow filesystem enumeration' , 1 , 269 ),
2432
+ ( ' polybase enabled' , 0 , 269 ),
2433
+ ( ' suppress recovery model errors' , 0 , 269 ),
2434
+ ( ' openrowset auto_create_statistics' , 1 , 269 ),
2435
+ ( ' external rest endpoint enabled' , 0 , 269 ),
2436
+ ( ' external xtp dll gen util enabled' , 0 , 269 ),
2437
+ ( ' external AI runtimes enabled' , 0 , 269 ),
2438
+ ( ' allow server scoped db credentials' , 0 , 269 );
2439
+
2440
+ /* Either 0 or 16 is fine here */
2441
+ IF EXISTS (
2442
+ SELECT * FROM sys .configurations
2443
+ WHERE name = ' min server memory (MB)'
2444
+ AND value_in_use IN (0 , 16 )
2445
+ )
2446
+ BEGIN
2447
+ INSERT INTO #ConfigurationDefaults
2448
+ SELECT ' min server memory (MB)' , CAST (value_in_use AS BIGINT ), 1036
2449
+ FROM sys .configurations
2450
+ WHERE name = ' min server memory (MB)' ;
2451
+ END
2457
2452
ELSE
2458
- BEGIN
2459
- INSERT INTO #ConfigurationDefaults
2460
- VALUES ( ' remote login timeout (s)' , 10 , 1069 );
2461
- END ;
2462
- INSERT INTO #ConfigurationDefaults
2463
- VALUES ( ' remote proc trans' , 0 , 1050 );
2464
- INSERT INTO #ConfigurationDefaults
2465
- VALUES ( ' remote query timeout (s)' , 600 , 1051 );
2466
- INSERT INTO #ConfigurationDefaults
2467
- VALUES ( ' Replication XPs' , 0 , 1052 );
2468
- INSERT INTO #ConfigurationDefaults
2469
- VALUES ( ' RPC parameter data validation' , 0 , 1053 );
2470
- INSERT INTO #ConfigurationDefaults
2471
- VALUES ( ' scan for startup procs' , 0 , 1054 );
2472
- INSERT INTO #ConfigurationDefaults
2473
- VALUES ( ' server trigger recursion' , 1 , 1055 );
2474
- INSERT INTO #ConfigurationDefaults
2475
- VALUES ( ' set working set size' , 0 , 1056 );
2476
- INSERT INTO #ConfigurationDefaults
2477
- VALUES ( ' show advanced options' , 0 , 1057 );
2478
- INSERT INTO #ConfigurationDefaults
2479
- VALUES ( ' SMO and DMO XPs' , 1 , 1058 );
2480
- INSERT INTO #ConfigurationDefaults
2481
- VALUES ( ' SQL Mail XPs' , 0 , 1059 );
2482
- INSERT INTO #ConfigurationDefaults
2483
- VALUES ( ' transform noise words' , 0 , 1060 );
2484
- INSERT INTO #ConfigurationDefaults
2485
- VALUES ( ' two digit year cutoff' , 2049 , 1061 );
2486
- INSERT INTO #ConfigurationDefaults
2487
- VALUES ( ' user connections' , 0 , 1062 );
2488
- INSERT INTO #ConfigurationDefaults
2489
- VALUES ( ' user options' , 0 , 1063 );
2490
- INSERT INTO #ConfigurationDefaults
2491
- VALUES ( ' Web Assistant Procedures' , 0 , 1064 );
2492
- INSERT INTO #ConfigurationDefaults
2493
- VALUES ( ' xp_cmdshell' , 0 , 1065 );
2453
+ BEGIN
2454
+ INSERT INTO #ConfigurationDefaults
2455
+ VALUES (' min server memory (MB)' , 0 , 1036 );
2456
+ END ;
2457
+
2494
2458
2495
2459
IF NOT EXISTS ( SELECT 1
2496
2460
FROM #SkipChecks
0 commit comments