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

asked 04 Jun '12, 13:52

kk2ask's gravatar image

accept rate: 0%

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.

permanent link

answered 04 Jun '12, 14:51

Glenn%20Paulley's gravatar image

Glenn Paulley
accept rate: 43%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 04 Jun '12, 13:52

question was seen: 1,462 times

last updated: 04 Jun '12, 14:51