Hi , i have created a procedure
create procedure testProcedure_One
as
DECLARE @Query nvarchar(4000)
begin
SET @Query = 'SELECT * into #temptest FROM Table1'
Exec sp_Executesql @query
SELECT * FROM #temptest drop table #temptest end
When i run the procedure testProcedure_One i am getting "Invalid object name '#temp' " error message
but if i use ##temp means its working.
create procedure testProcedure_two
as
DECLARE @Query nvarchar(4000)
begin
SET @Query = 'SELECT * into ##temptest FROM Table1'
Exec sp_Executesql @query
SELECT * FROM ##temptest drop table ##temptest end
testProcedure_two is working fine the What might be the issue . How can i solve it ?
Please help.