Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2012-05-17 : 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_filesWHERE database_id = 1 AND file_id = 1IF EXISTS(SELECT name FROM sys.databasesWHERE name = @DBName)exec('DROP DATABASE ['+ @DBName+']')SET @SQL = ' CREATE DATABASE [' + @DBName + ']ONPRIMARY(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)GOUSE [CustomerDBName]GoKamran ShahidPrinciple Engineer Development(MCSD.Net,MCPD.net) |
|
Sachin.Nand
2937 Posts |
Posted - 2012-05-17 : 02:20:19
|
So whats the question ?After Monday and Tuesday even the calendar says W T F .... |
 |
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2012-05-17 : 02:23:08
|
Is there any problem appearing in this script?Kamran ShahidPrinciple Engineer Development(MCSD.Net,MCPD.net) |
 |
|
Sachin.Nand
2937 Posts |
Posted - 2012-05-17 : 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
3 Posts |
Posted - 2012-05-25 : 00:06:42
|
Is there any problem appearing in this script?unspammedBree Vandicamp |
 |
|
|
|
|