Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
hai
Yak Posting Veteran
84 Posts |
Posted - 2007-05-18 : 09:32:37
|
| I have a developer that used temp table to store data usingthe select * into #tbl. Apparently the data got delete, I was just wondering how hong does the temp #tbl hold the data, and when does it delete the data?thanks |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-18 : 09:36:59
|
the data in the temp table will not be automatically deleted. However the temp table only exists within the scope. It is automatically dropped when it is out of scope KH |
 |
|
|
hai
Yak Posting Veteran
84 Posts |
Posted - 2007-05-18 : 09:46:47
|
| Khan,what do you mean by scope? If the temp #table create by one user, can another user log in and use the temp #tbl? As you can see...i'm very new to this.thanks |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-18 : 09:50:22
|
| No. The local temp table created by one user will be visible only to him/her.By scope, it means the temp table is visible only to the connection in which it is created. Once the connection is closed, the table cease to exist.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-18 : 11:25:18
|
| Do google search on "Temporary table+sql server"MadhivananFailing to plan is Planning to fail |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|