I've got my code sort of segregated as "coherent blocks" that I can insert into a longer "configuration script" over and over, and one of the patterns I'm using is this:
CREATE TABLE #WidgetSetting ( WidgetID bigint not null, Name nvarchar(100) not null, Value nvarchar(max) not null, CreateDate datetime not null ) INSERT VALUES MERGE TABLES DROP TABLE #WidgetSetting
But now SSMS is complaining that the object already exists by the next time the
CREATE TABLE fires. What gives?
I think it's obvious I'm going to have to declare the table once at the beginning of the script, truncate instead of drop, but it's frustrating, naturally, to not be able to just drop the table and use the same name again.