Instantly share code, notes, and snippets.

Embed
What would you like to do?
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2Categories')
BEGIN
CREATE DATABASE [K2Categories] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Categories.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Categories_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2Dependencies')
BEGIN
CREATE DATABASE [K2Dependencies] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Dependencies.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Dependencies_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2EnvironmentSettings')
BEGIN
CREATE DATABASE [K2EnvironmentSettings] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2EnvironmentSettings.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2EnvironmentSettings_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2EventBus')
BEGIN
CREATE DATABASE [K2EventBus] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2EventBus.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2EventBus_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2EventBusScheduler')
BEGIN
CREATE DATABASE [K2EventBusScheduler] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2EventBusScheduler.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2EventBusScheduler_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2HostServer')
BEGIN
CREATE DATABASE [K2HostServer] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2HostServer.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2HostServer_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2Server')
BEGIN
CREATE DATABASE [K2Server] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Server.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Server_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2ServerLog')
BEGIN
CREATE DATABASE [K2ServerLog] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2ServerLog.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2ServerLog_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2SmartBox')
BEGIN
CREATE DATABASE [K2SmartBox] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2SmartBox.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2SmartBox_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2SmartBroker')
BEGIN
CREATE DATABASE [K2SmartBroker] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2SmartBroker.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2SmartBroker_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2SQLUM')
BEGIN
CREATE DATABASE [K2SQLUM] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2SQLUM.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2SQLUM_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2WebDesigner')
BEGIN
CREATE DATABASE [K2WebDesigner] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2WebDesigner.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2WebDesigner_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2WebWorkflow')
BEGIN
CREATE DATABASE [K2WebWorkflow] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2WebWorkflow.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2WebWorkflow_log.LDF')
FOR ATTACH;
END
GO
IF NOT EXISTS (SELECT TOP 1 1 FROM sys.databases WHERE name = 'K2Workspace')
BEGIN
CREATE DATABASE [K2Workspace] ON
(FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Workspace.mdf')
, (FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\K2Workspace_log.LDF')
FOR ATTACH;
END
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment