I have a serialised piece of data in a column that I want to retrieve a single value from, in the following form:
<FirstNode>Something</><SecondNode>Something Else</>
I want to retrieve, for example, 'Something' from this in SQL Server. I've tried the following:
declare @data xml;
set @data = cast([my data source] as xml);
select @data.value('(/UserName)[1]','varchar(50)')
I'm probably way off with this, I don't have a huge deal of experience with parsing XML. Any help would be great.
Edit: I get the error
XML parsing: line 1, character 20, illegal qualified name character