Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 5th, 2007, 01:37 PM
Registered User
 
Join Date: Jul 2007
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
 
Old July 5th, 2007, 01:49 PM
Registered User
 
Join Date: Jun 2007
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.


 
Old January 2nd, 2009, 05: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...
 
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.





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 [email protected] Access 1 April 26th, 2005 06:45 AM
building blocks (page 562) terry s Dreamweaver (all versions) 1 January 13th, 2005 02:10 PM
Accounting Database Lighthouse Access VBA 4 April 4th, 2004 05:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.