Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare @source xml = '<place source XML result here>';
declare @target xml = '<place target xml result here>';
declare @target xml = '<place target XML result here>';

with
src as(
Expand Down Expand Up @@ -31,11 +31,18 @@ select property = 'TEMPDB:'+y.v.value('local-name(.)', 'nvarchar(300)'),
value = y.v.value('.[1]', 'nvarchar(300)')
from @target.nodes('//tempdb') x(v)
cross apply x.v.nodes('*') y(v)
)
),
diff as (
select property = isnull(src.property, tgt.property),
source = src.value, target = tgt.value
source = src.value, target = tgt.value,
is_missing = (case when src.value is null or tgt.value is null then 1 else 0 end)
from src full outer join tgt on src.property = tgt.property
where (src.value <> tgt.value
or src.value is null and tgt.value is not null
or src.value is not null and tgt.value is null)
order by isnull(src.property, tgt.property)
)
select *
from diff
where is_missing = 0 -- comment-out this line to compare missing properties.
order by property

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ where name = @db_name
for xml raw('db'), elements);
set @result += (select compatibility_level, snapshot_isolation_state_desc, is_read_committed_snapshot_on,
is_auto_update_stats_on, is_auto_update_stats_async_on, delayed_durability_desc,
is_encrypted, is_auto_create_stats_incremental_on, is_arithabort_on, is_ansi_warnings_on, is_parameterization_forced
is_encrypted, is_auto_create_stats_incremental_on, is_arithabort_on, is_ansi_warnings_on, is_parameterization_forced,
number_of_files = (select count(*) from master.sys.master_files where database_id = db_id('tempdb'))
from sys.databases
where name = 'tempdb'
for xml raw('tempdb'), elements);
Expand Down