How to get the second or third element DYNAMICALLY of a XML document on XQuery with SQL Server
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)');
select @X.value('(/translations/value[@lang="'''+cast( @Temp as varchar)+'''"])[1]','varchar(max)');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)