Hello,I have the following:if exists (select name from sys.databases where name = @DatabaseName) begin alter database @DatabaseName set single_user with rollback immediate go drop database @DatabaseName go end
I get an error on the second go:Incorrect sintax near go.Basically I am checking if the database exists. If yes then close all connections to it and drop it.What am I missing?Am I closing the connections correctly?Thanks,Miguel