This XML format is a given (it comes from an app my company runs):
<User display="User">NAME1</User>
So I've been running the following code to try and tease out the true value (NAME1) from this format:
declare @xml xml = '<User display="User">NAME1</User>'
select @xml.value('(User/@display)[1]', 'nvarchar(max)') as USER_NM
I'm using SQL Server 2012. But nothing I try can pick out the NAME1, rather than User. Any ideas?