May 13, 2012 at 5:44 am
create database contacts
on primary
(
name='contacts',
filename='D:\contacts\contacts.mdf',
size=5mb,
filegrowth=3%
)
log on
(
name='contacts',
filename='D:\contacts\contacts.ldf'
size=5mb,
filegrowth=3%
)
June 13, 2012 at 9:33 am
try
create database contacts
on primary
(
name='contacts',
filename='D:\contacts\contacts.mdf',
size=5mb,
filegrowth=3%
)
log on
(
name='contacts',
filename='D:\contacts\contacts_log.ldf',
size=5mb,
filegrowth=3%
)
June 13, 2012 at 10:13 am
Few problems
There's a missing comma after the log file's physical name (which is what causes that error)
You've given the data and log files the same logical name. File names must be unique within a database.
Also, 3% growth is not a recommended setting. Set the growth to a fixed increment that's sensible considering the size of teh DB and the expected growth.
This works and has a much more optimal growth setting for the DB.
CREATE DATABASE contacts ON PRIMARY (
NAME='contacts',
FILENAME='D:\Develop\Databases\contacts.mdf',
SIZE=5mb,
FILEGROWTH=1mb
)
LOG ON (
NAME='contacts_log',
FILENAME='D:\Develop\Databases\contacts.ldf',
SIZE=5mb,
FILEGROWTH=1mb
)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply