|
|
 |
BOOK: Beginning SQL Server 2005 Programming ISBN: 978-0-7645-8433-6  | This is the forum to discuss the Wrox book Beginning SQL Server 2005 Programming by Robert Vieira; ISBN: 9780764584336 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning SQL Server 2005 Programming ISBN: 978-0-7645-8433-6 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

July 5th, 2007, 02:37 PM
|
|
Registered User
|
|
Join Date: Jul 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Building 'Accounting' Database, page 119
Hey everyone,
I am a newbie beginner to SQL Server 2005. I am having problems with building the 'Accounting' database on page 119. I enter the code exactly as is in the book and get an error msgs. "Msg 153, Level 15, State 1, Line 5
Invalid usage of the option SIZE in the CREATE/ALTER DATABASE statement."
I enter the query in the Management Studio using the Model database as the dropdown. What am I doing wrong? Help Please. Much appreciated.
jrncubs
|

July 5th, 2007, 02:49 PM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Given that it says, "system cannot find the path specified." It is possible that your SQL Server installation is in a different folder and the paths in the script need to be modified to match. Using Windows Explorer (aka My Computer), try browsing each folder listed in the path. You are looking for the folder where the other .mdf files are located. You can also search for *.mdf to find the correct path. Then modify the two c: paths in the script accordingly. Good luck.
|

January 2nd, 2009, 05:48 PM
|
|
Registered User
|
|
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am experiencing the same problem.
I copied the code from the sample script and I changed the path to the location of the Adventure Works MDF/LDF files... I have also tried changing the path to the location of the PUBS/Northwinds DB's (as they reside in a folder of the root of my c: drive...) Either way I get the following:
Msg 153, Level 15, State 1, Line 5
Invalid usage of the option SIZE in the CREATE/ALTER DATABASE statement.
Any light someone might be able to shed on this would greatly be appreciated...
|

October 18th, 2009, 03:12 PM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Create Database Accounting problem [RESOLVED]
In the book on page 119 (chapter 5) in creating database Accounting there is mistake in FILENAME path:
Code:
CREATE DATABASE Accounting
ON
(NAME = 'Accounting',
FILENAME = 'c:\Program Files\Microsoft SQLServer\MSSQL.1\mssql\data\Accounting.mdf,
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5)
LOG ON
(NAME = 'AccountingLog',
FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\mssql\data\AccountingLog.ldf',
SIZE = 5 MB,
MAXSIZE = 25 MB,
FILEGROWTH = 5 MB)
GO
After execution of this script you get this message:
Code:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "c:\Program Files\Microsoft SQLServer\MSSQL.1\mssql\data\AccountingData.mdf" failed with the operating system error 3(failed to retrieve text for this error. Reason: 15105).
Msg 1802, Level 16, State 1, Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
This is the correct script:
Code:
CREATE DATABASE Accounting
ON
(NAME = 'Accounting',
FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\mssql\data\AccountingData.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5)
LOG ON
(NAME = 'AccountingLog',
FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL.1\mssql\data\AccountingLog.ldf',
SIZE = 5 MB,
MAXSIZE = 25 MB,
FILEGROWTH = 5 MB)
GO
Enjoy.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |