Posted onSeptember 7, 2011 by Josephine drop database IF EXISTS (SELECT name FROM sys.databases WHERE name = N’dbname’) DROP DATABASE [dbname] GO