SQLTeam.com | Weblogs | Forums

Proper syntax to remove temp table


#1

suppose I have a script as follows:
SELECT * into #indep from
(
....
)

Afterwards it wont run...( There is already an object named '#indep' in the database. )
.even with this

IF (SELECT object_id('#indep')) IS NOT NULL

BEGIN
DROP TABLE #indep
END


#2
IF OBJECT_ID('tempdb..#indep') IS NOT NULL
    DROP TABLE #indep

#3

thanks - what does .. imply ?
( works great thanks ! )


#4

What should be between the two dots is the schema name. When omitted = current schema


#5

thanks !!!