例如:
declare @xml1 xml = '<Xml1/>' declare @xml2 xml = '<Xml2/>' select case when @xml1 = @xml2 then 1 else 0 end
select case when cast(@xml1 as nvarchar(max)) = cast(@xml2 as nvarchar(max)) then 1 else 0 end