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
asked 04 Jun '12, 13:52
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.
answered 04 Jun '12, 14:51