Query SQL Server XML column for value

Just an example of how to pull this type of value from an embedded XML document in a SQL Server database table column…

select top 100  *
  from  Transactions with (nolock)
  where trn_xml.value('(/Transaction/RetailStoreId)[1]', 'int') = 2401

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.