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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 drop Temporary table

Author  Topic 

khufiamalik
Posting Yak Master

120 Posts

Posted - 2009-02-19 : 08:49:50
Hello All,
My DB name is PrizeDB, and I have created a Temporary table in my SP.
the name of Table is #PrizeInfoTable.

I want to drop it,
can some one give me the exact code that how to drop it.

Thanks in advance

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-19 : 08:51:08
drop table #PrizeInfoTable
Go to Top of Page

khufiamalik
Posting Yak Master

120 Posts

Posted - 2009-02-19 : 08:53:53
should I check it like
IF OBJECT_ID('tempdb..#PrizeInfoTable') IS NOT NULL DROP TABLE #PrizeInfoTable;

even my database name is PrizeDB
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-02-19 : 08:54:05
use PrizeDb

Drop Table #PrizeInfoTable
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-19 : 09:02:53
quote:
Originally posted by khufiamalik

should I check it like
IF OBJECT_ID('tempdb..#PrizeInfoTable') IS NOT NULL DROP TABLE #PrizeInfoTable;

even my database name is PrizeDB




Thats perfect.
Go to Top of Page
   

- Advertisement -