This project has moved. For the latest updates, please go here.

Improvement to the new database script

Topics: General '15
Jul 27, 2011 at 8:12 PM
Edited Jul 27, 2011 at 9:20 PM

I can submit a formal patch if desired, but I actually didn't see where in the TFS repo this is stored. If the script does not run for you and you want to run it multiple times, the rollback will kill all the existing connections while you fiddle with it. Turning on NOCOUNT gets rid of useless messages.

/****** Survey database install v1.2.3 ******/

USE MASTER;
GO

SET NOCOUNT ON;

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

CREATE DATABASE [NSurvey] COLLATE SQL_Latin1_General_CP1_CI_AS
GO

 

Also, at the bottom, you might want to consider CREATE LOGIN and CREATE USER as opposed to the deprecated stored procs currently being used.

Thanks,

Justin Dearing

Coordinator
Jul 31, 2011 at 8:17 PM

Hello Justin,

Thank you very much for a good suggestion. It has been added to the Issue tracker as Item # 9012. It will be picked up as a possible feature for the next Survey release. You can always use the Issue tracker to make your suggestions or like you did now create a new discussion.

Thanks for your involvement.

Kind regards
Fwsmaster