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
First, the sp_xml_preparedocument stored procedure parses the XML document. The parsed document is a tree representation of the nodes (elements, attributes, text, and comments) in the XML document. OPENXML then refers to this parsed XML document and provides a rowset view of all or parts of this XML document.
select case when cast(@xml1 as nvarchar(max)) = cast(@xml2 as nvarchar(max)) then 1 else 0 end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With