cancel
Showing results for 
Search instead for 
Did you mean: 

#table not found no change in proc

Former Member
0 Kudos
1,885

Hi All,

thanks in advance, i have a proc that create a #table ex create #table(myid int,myname varchar(10))

now i do a insert into thsi table from another view inside my proc

later i do a select from this table and that is where the proc thows a error that the table does not exists

it occurs on rare occasions otherwise the proc works fine

can anyone help to understand why this happends at a rare occassions when table is actually created inside this proc and used

Thanks kishore

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

If you use DECLARE TEMPORARY TABLE, or implicitly create a table via SELECT INTO, then the table's scope is the life of the block in which it's created - but if you use CREATE TEMPORARY TABLE, then the temporary table has connection scope and lives for the life of the connection (and hence across procedures).

So - to answer your question we'll need to see the exact code you're using.