Here is what I am trying to accomplish...
frist I am creating a temp table
drop table #TRCTempTable
create table #TRCTempTable(doc_set_id int,
Then creating a stored procedure which is passed an SQL string...
CREATE PROCEDURE FirstQuery(@sqlstr text) AS
FROM consultant_lkup CL,#TRCTempTable TT
WHERE CL.consultant_num =* TT.consultant_num
Then problem is, I keep getting the error:
Msg 208, Level 16, State 1
Invalid object name '#TRCTempTable'.
I think the problem exists in the EXEC statement, but I'm not sure. I need to find a work around.