USE master GO IF EXISTS ( SELECT name FROM sys.databases WHERE name = N'myDB' ) DROP DATABASE myDB GO