Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 5th, 2007, 01:37 PM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old July 5th, 2007, 01:49 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.


Reply With Quote
  #3 (permalink)  
Old January 2nd, 2009, 04:48 PM
Registered User
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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...
Reply With Quote
  #4 (permalink)  
Old October 18th, 2009, 02:12 PM
Registered User
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up 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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 4 pp. 118-119 luciano991 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 August 13th, 2006 01:56 PM
Building accounting receivable query mustafayildirim@msn.com Access 1 April 26th, 2005 06:45 AM
building blocks (page 562) terry s Dreamweaver (all versions) 1 January 13th, 2005 01:10 PM
Accounting Database Lighthouse Access VBA 4 April 4th, 2004 05:35 PM



All times are GMT -4. The time now is 08:06 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.