Home How to get the second or third element DYNAMICALLY of a XML document on XQuery with SQL Server
Reply: 0

How to get the second or third element DYNAMICALLY of a XML document on XQuery with SQL Server

user299
1#
user299 Published in July 20, 2018, 1:19 am
declare @X xml='<translations><value lang="en-US">example</value><value lang="1">Beispiel</value></translations>';
declare @Temp int
set @Temp=1
select @X.value('(/translations/value[@lang="'''+@Temp+'''"])[1]','varchar(max)');
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307836 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO