开发者

SQL Server 2008: How to compare XML?

Is there are way to compare variables or columns of XML in SQL Server 2008, which 开发者_高级运维is different from comparing a varchar that can be made from the XML value? Some hashing mechanisms?

For example:

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 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜