The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

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

kk2ask
0111
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
10.7k568104
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

By RSS:

Answers

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:

×100

question asked: 04 Jun '12, 13:52

question was seen: 827 times

last updated: 04 Jun '12, 14:51