找到了。而不是使用query(),我应该使用exist()。
我的查询将是
SELECt id, xml.query('data(/xml/info/@name)') as ValueFROM Table1WHERe xml.exist('/xml/info/[@name=sql:variable("@match")]') = 1
找到了。而不是使用query(),我应该使用exist()。
我的查询将是
SELECt id, xml.query('data(/xml/info/@name)') as ValueFROM Table1WHERe xml.exist('/xml/info/[@name=sql:variable("@match")]') = 1