declare @xml xml, declare @num int set @num = 1 set @xml = ' <row> <Id>1</Id> <name>reza</name> </row> <row> <Id>2</Id> <name>Masoud</name> </row> '
how to select ID = @num ??
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
Use XPath filters:
'/row[Id/text()="1"]' would also work for your example, as well as
'/row[Id="1"]' or even