| Author |
Topic  |
|
|
kamii47
Constraint Violating Yak Guru
335 Posts |
Posted - 05/17/2012 : 02:09:58
|
I have following script for database creation. (which is working fine a month back.Certainly i am getting difference in script (I use adeptsqldiff for comparison))
use master /* SEQ01_CREATE_DATABASE */ DECLARE @SQL VARCHAR(MAX) DECLARE @DBName VARCHAR(50) DECLARE @DBPath VARCHAR(255)
SET @DBName = 'CustomerDBName'
SELECT @DBPath = SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1) FROM master.sys.master_files WHERE database_id = 1 AND file_id = 1
IF EXISTS(SELECT name FROM sys.databases WHERE name = @DBName) exec('DROP DATABASE ['+ @DBName+']')
SET @SQL = ' CREATE DATABASE [' + @DBName + '] ON PRIMARY (NAME = [' + @DBName + '], FILENAME = '''+ @DBPath + @DBName + '.mdf'', SIZE = 200MB, FILEGROWTH = 100MB); ALTER DATABASE [' + @DBName + '] MODIFY FILE ( NAME = ''' + @DBName + '_log'', MAXSIZE = 2048GB , FILEGROWTH = 100MB); Alter DATABASE [' + @DBName + '] Set ALLOW_SNAPSHOT_ISOLATION ON;' EXEC (@SQL) GO
USE [CustomerDBName]
Go
Kamran Shahid Principle Engineer Development (MCSD.Net,MCPD.net)
|
|
|
Sachin.Nand
Flowing Fount of Yak Knowledge
2937 Posts |
Posted - 05/17/2012 : 02:20:19
|
So whats the question ?
After Monday and Tuesday even the calendar says W T F .... |
 |
|
|
kamii47
Constraint Violating Yak Guru
335 Posts |
Posted - 05/17/2012 : 02:23:08
|
Is there any problem appearing in this script?
Kamran Shahid Principle Engineer Development (MCSD.Net,MCPD.net)
|
 |
|
|
Sachin.Nand
Flowing Fount of Yak Knowledge
2937 Posts |
Posted - 05/17/2012 : 03:33:36
|
I tried it and its working fine for me.
After Monday and Tuesday even the calendar says W T F .... |
 |
|
|
ivycool
Starting Member
USA
3 Posts |
Posted - 05/25/2012 : 00:06:42
|
Is there any problem appearing in this script? unspammed
Bree Vandicamp |
 |
|
| |
Topic  |
|