Convert string to xml in SQL Server 2005

scsaus

New Member
I have a string that I want to convert it to XML but it is giving me an error.\[code\] <error>A string literal was expected<error>SET @xmlString = '<OrgStructureRole><SurveyId>13</SurveyId><UserName>xyz13</UserName><UserName>rmn456</UserName><Rule OrgTreeID=131705></Rule><Rule OrgTreeID=131721></Rule></OrgStructureRole>'\[/code\]I am trying to convert this by using this way.\[code\]SELECT convert(xml,@xmlString)\[/code\]Any suggestions?
 
Back
Top