은 현재 내가 결과를 얻으려면이 쿼리를 사용하고 있습니다 : 내가 쿼리에 하드 코딩 된 문자열 대신 입력 매개 변수를 사용할 수있는 방법쿼리 XML은
Select *
From Staff
Where StaInsurance.exist('/COLInsuranceCompany/DOInsuranceCompany[Name/text()[. = "Apollo Life Assurance"]]') = 1
을 아래 작동하지 않았다 :
declare @IInsurance nvarchar(200)
set @IInsurance = 'Apollo Life Assurance'
Select *
From Staff
Where StaInsurance.exist('(/COLInsuranceCompany/DOInsuranceCompany/Name[id=(sql:variable("@IInsurance"))])[1]') = 1
예 : xml 추가 – Backs