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

user4274
1#
user4274 Published in September 19, 2018, 11:02 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)');
share|improve this question

1 Answer 1

active oldest votes
up vote 1 down vote
You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO