Personal Notes of Edwin Eu

Create a database

In Microsoft SQL Server on 07/12/2012 at 9:40 AM

 The “CREATE DATABASE <Database Name>” will impact to database performance issue  if it’s not utilize properly.

There are many articles has discussed and posted.

I would recommend to issues a complete a statement instead of CREATE DATABASE <Database Name> :

CREATE DATABASE BearCreek ONPRIMARY

(NAME =N’BearCreek_Data’,FILENAME=N’M:\SQL_Data\BearCreek.mdf’,

SIZE= 8MB, MAXSIZE =UNLIMITED, FILEGROWTH = 16MB),

FILEGROUP FG1

(NAME =N’BearCreek_Data2′,FILENAME=N’M:\SQL_Data\BearCreek.ndf’,

SIZE= 8MB, MAXSIZE =UNLIMITED, FILEGROWTH = 16GB),

FILEGROUP BearCreekDocuments

CONTAINSFILESTREAMDEFAULT

(NAME =N’BearCreekDocuments’,FILENAME=N’M:\SQL_Data\BearCreekDocuments’)

LOG ON

(NAME =N’BearCreek_Log’,FILENAME=‘L:\SQL_Log\BearCreek.ldf’,

SIZE= 8MB, MAXSIZE =UNLIMITED, FILEGROWTH = 16MB)

GO

ALTER DATABASE BearCreek

MODIFY FILEGROUP FG1

DEFAULT

GO

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: