USE master GO ---- Drop the database if it already exists IF EXISTS ( SELECT name FROM sys.databases WHERE name = N'myDB' ) DROP DATABASE myDB GO ---- Create Database CREATE DATABASE myDB GO