I have declared a @xmldata as xml. How to read it? I tried
declare @xmldata as xml
set @xmldata = <root><row ename='abc' eid='1'/></root>
SELECT @XMLDATA
but it returned an error. I want to fetch eid column from the above xml type.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this:
Update: if you need to select from your table and extract something from the XML column, use this approach: