September 6, 2010 at 5:25 am
Hi
i want to drop a temptable
and then create it again
September 6, 2010 at 5:29 am
Ok.
DROP TABLE #TableName
CREATE TABLE #TableName (<table definition>)
Is there a question here?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 6, 2010 at 5:32 am
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL
DROP TABLE #TempTable
CREATE TABLE #TempTable
(
A INTEGER,
B VARCHAR(10) ,
C MONEY,
D XML
)
You can run this code many times, without the error "Object already existing"
Hope this is what u wanted..
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply