XQuery and contains() function

  • Hi all,

    I am trying to return the specific block of XML where the @SearchTerm phrase was found. I was trying to use the query() and contains() methods to get the specific block where the phrase was found.

    here my query.

    DECLARE @SearchTerm varchar(3000) = 'Availability through Health Insurance Exchange'

    DECLARE @SearchTerm2 varchar(3000) = '"Availability through Health Insurance Exchange"'

    SELECT

    BillText.query('contains(.,sql:variable("@SearchTerm"))')

    ,*

    FROM

    Legislative.BillText bt

    INNER JOIN CONTAINSTABLE (Legislative.BillText,BillText,@SearchTerm2) as k

    ON k.[Key] = bt.BillTextID

    What am I missing?

    Thanks

    Brian W

  • You are mixing both XML (xquery) and FULLTEXT?


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply