# Saturday, July 21, 2007
« Out Parameters With Rhino Mocks | Main | Coco-R »
Sometimes I like to drop databases locally even when I'm connected to them.  This usually comes in handy when I'm rebuilding a DB using a script.

USE MASTER
GO

-- If the database already exists, drop it
IF EXISTS(SELECT * FROM sysdatabases WHERE name='Northwind')
ALTER DATABASE Northwind SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

IF EXISTS(SELECT * FROM sysdatabases WHERE name='Northwind')
    DROP DATABASE Northwind
GO


Comments are closed.