Skip to content

Commit b53f6fe

Browse files
Update get-properties.sql
1 parent c91f143 commit b53f6fe

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

  • samples/manage/azure-sql-db-managed-instance/compare-environment-settings

samples/manage/azure-sql-db-managed-instance/compare-environment-settings/get-properties.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ insert into @tf execute('DBCC TRACESTATUS(-1)');
2424
set @result += ISNULL((
2525
select name=CONCAT('TF:',TraceFlag), value=status from @tf
2626
where global=1 and session=0
27+
and (TraceFlag in (8690 -- https://blogs.msdn.microsoft.com/psssql/2015/12/15/spool-operator-and-trace-flag-8690/
28+
, 8744, 9347, 9349, 9471, 9476, 9488 -- Plan affecting TFs include others such as
29+
, 9453, 9495 -- Execution related TFs
30+
, 4199, 9481 /*force legacy CE*/, 2312 /* force default CE */
31+
--https://kohera.be/blog/sql-server/trace-flags-sql-servers-transformer-like-tuning/
32+
, 1118, 2371, 610, 1117, 8048, 1236, 8015, 834, 1224, 2335,
33+
-- Taking care of Query-Hint-Hell
34+
4136, 8602, 8722, 8755,
35+
-- random trace flags aka.ms/traceflags
36+
634, 3459, 3468, 3505, 9495,
37+
9347, 9349, 9389, 9398, 9453 -- batch mode related
38+
39+
)
40+
or TraceFlag between 4100 and 4120
41+
)
2742
for xml raw, elements
2843
),'');
2944
set @result += (
@@ -37,6 +52,7 @@ where name in ('cost threshold for parallelism','cursor threshold','fill factor
3752
,'set working set size','user connections')
3853
for xml raw, elements
3954
);
55+
set @result += (select name = 'version', value = @@VERSION for xml raw, elements)
4056
select cast(@result as xml);
4157
end;
4258

0 commit comments

Comments
 (0)