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 |
|
chih
Posting Yak Master
154 Posts |
Posted - 2008-03-24 : 20:01:12
|
| Hi Everyone,If i executeselect * into #tmp from member select * from #tmpdrop table #tmpselect * into #tmp from member select * from #tmpit will say 'There is already an object named '#tmp' in the database.'Why?? I have droped the table.thanks in advance, |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-03-24 : 22:26:32
|
| Have to run 'drop table #tmp' in its own batch. |
 |
|
|
QAZAFI
Yak Posting Veteran
50 Posts |
Posted - 2008-03-24 : 23:22:09
|
| Hi DearThis is the solution to your question. I have just put a “GO” after the drop statement and it will do the magic :). “GO” Signals the end of a batch of Transact-SQL statements to the SQL Server utilitiesselect * into #tmp from module select * from #tmpdrop table #tmpGOselect * into #tmp from module select * from #tmp |
 |
|
|
chih
Posting Yak Master
154 Posts |
Posted - 2008-03-24 : 23:30:38
|
| Thank you |
 |
|
|
|
|
|