I have this view (or cte)
with data like
and I want to use this data to build a looping query that would give me something like
where I use the results from the first view/query to build the second query. Any suggestions since my ideas aren't working?
wb
Code:
select protocolid, dtblname, v_name from cte
with data like
Code:
protocolid dtblname v_name
108 tblEligibility BASELINE_CANCER-HX_BLADDER-ONLY_CODE
108 tblEligibility BASELINE_CANCER-HX_CHEMO-EVER_CODE
108 tblEligibility BASELINE_CANCER-HX_CONFIRMATION_CODE
108 tblEligibility BASELINE_CANCER-HX_GENE-THERAPY-SPECIFY_TEXT
and I want to use this data to build a looping query that would give me something like
Code:
select v_name from dbedrn(protocolid).dbo.dtblname
where I use the results from the first view/query to build the second query. Any suggestions since my ideas aren't working?
wb