Click here to Skip to main content
15,937,127 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i use name in node exist query from table?
I want the solution without using loop

What I have tried:

This is my query

select distinct ItemId,X.Y.value('./@Name', 'VARCHAR(200)')  from ItemExt e
CROSS APPLY e.ItemCustomPropertyXmlData.nodes('ExtendedProperties/Property') as X(Y)
where cast(ItemCustomPropertyXmlData as xml).exist('/ExtendedProperties/Property[@Name eq "'+X.Y.value('./@Name', 'VARCHAR(200)')+'"]') = 1

After executing above query getting "The argument 1 of the XML data type method "exist" must be a string literal" error
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900