Chapter 5 Creating Database Files
I am having trouble creating my first database file. Here is the syntax used:
CREATE DATABASE Accounting
ON
(NAME = 'Accounting',
FILENAME = 'C:\Program Files\Microsoft SQL
SERVER\MSSQL10.SQLEXPRESS\MSSQL\DATA\AccountingDat a.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5)
LOG ON
(NAME = 'AccountingLog',
FILENAME = 'C:\Program Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\AccountingLog .ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB);
GO
And I get an error message when executed:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program Files\Microsoft SQL
SERVER\MSSQL10.SQLEXPRESS\MSSQL\DATA\AccountingDat a.mdf" failed with the operating system error 123(The filename, directory name, or volume label syntax is incorrect.).
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
I have double checked my file name path, I have removed spaces in the syntax, added underscores, and changed the folder from MSSQL10.SQLEXPRESS to MSSQL11.TSQLLAB as that is where my adventure works database is. I keep getting the same error and cannot figure out why this isn't working, when the directory path is correct and has been verified multiple times.
Can someone please help me figure out what I am missing?
|