write something like below
declare @para1 varchar(50)='Dilution Corrected Concentrations'
select case when @para1 = 'Fully Quantitative Concentrations' then
o.value('(defined_concentrations/sample[1]/analyte[1])[1]', 'VARCHAR(20)')
when @para1 = 'Dilution Corrected Concentrations' then
o.value('(results/sample/run/analyte[1])[1]', 'VARCHAR(20)')
else null end AS tmp
from @x.nodes('/plasmalab/section[@title= sql:variable("@para1")]') as a(o)
commented on Jun 18 2012 12:03PM