Patch to Surveymaster.sql

Jul 27, 2011 at 10:25 PM

An improvement to the first SQL script so it runs without errors the first time.

USE MASTER;
GO

SET NOCOUNT ON;

IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'SurveyMaster')
BEGIN
    ALTER DATABASE [SurveyMaster] SET OFFLINE WITH ROLLBACK IMMEDIATE;
	ALTER DATABASE [SurveyMaster] SET ONLINE;
	DROP DATABASE [SurveyMaster];
END
GO

Thanks,

Justin