verify that xml node contains/exists with a given value tsql



I have the following tables A (ID,relatedID,typeId ) B (ID,leftID,leftTypeId)


I want to join the two tables like this


select * from A inner join B on A.TypeId=B.LeftTypeId ans {condition}


where condition should verify id the leftID would match a value from relatedID, where relatedId is a xml column. Eg. relatedID=<Id>1</Id>


Is there a optimal way to do this?


No comments:

Post a Comment