TysonLPrice
Programmer
From what I've seen doing some searching the answer is no but maybe someone here has a solution.
I want to convert a SP from using a temporary table to using a table variable. The problem is the table is currently being loaded with an EXEC. I'm not going to post the whole thing because it is huge but here are the relevant pieces:
insert into #IntermediateBR
exec('
select *
,OtherReductions = ChargeAmount
...it goes on and on until
Where 1=1 ' + @WhereClause + ')
There are variables scattered throughout the parts of the select I omitted. The @WhereClause is built from a select to table that has the conditions inserted from a Visual Basic program.
So...I need a way to insert into a table variable a select that contains variables.
Any constructive suggestions?
I want to convert a SP from using a temporary table to using a table variable. The problem is the table is currently being loaded with an EXEC. I'm not going to post the whole thing because it is huge but here are the relevant pieces:
insert into #IntermediateBR
exec('
select *
,OtherReductions = ChargeAmount
...it goes on and on until
Where 1=1 ' + @WhereClause + ')
There are variables scattered throughout the parts of the select I omitted. The @WhereClause is built from a select to table that has the conditions inserted from a Visual Basic program.
So...I need a way to insert into a table variable a select that contains variables.
Any constructive suggestions?