Searching for Data in SQL XML Field RRS feed

  • Question

  • Hi All,

    I am using sql server 2016. Looking to find away to extract information in where clause on XML field. It is a very large database that I am currently working on. I am using the query below, but it is way too slow and runs for hours before timing out

    SELECT *
    FROM [FinancialTransactionXml] WIth (nolock)
      WHERE cast(TransactionXml as nvarchar(max)) like '%<Venue>FORT</Venue>%%<Product><Id>brandnew</Id></Product>%'

    Is there any suggestions on how to improve this query to run faster?.Table I am querying has 2 columns id,TransactionXML


    Wednesday, July 15, 2020 3:08 PM