There is already an object named '##Temp' in the database

前端 未结 5 1711
广开言路
广开言路 2021-01-04 04:23

I have a stored procedure on SQL Server 2000. It contains:
select ... into ##Temp ...
...
drop table ##Temp

When I run the stored procedure

5条回答
  •  悲哀的现实
    2021-01-04 04:57

    For me this solution works :

    IF (SELECT object_id ='#Temp') IS NOT NULL
    BEGIN
       DROP TABLE #Temp
    END
    

提交回复
热议问题