Wrox Programmer Forums
|
BOOK: Beginning Microsoft SQL Server 2012 Programming
This is the forum to discuss the Wrox book Beginning Microsoft SQL Server 2012 Programming Paul Atkinson, Robert Vieira ; ISBN: 978-1-1181-0228-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Microsoft SQL Server 2012 Programming 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 April 8th, 2013, 01:09 PM
Authorized User
 
Join Date: Jan 2013
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Running .sql file of page 182

Per the text, I tried to run the Chap06Accountingdb.sql directly from the text's download (see page 182), using the master and received:

Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\AccountingC0 6Data.mdf" failed with the operating system error 3(The system cannot find the path specified.).
Msg 1802, Level 16, State 1, Line 2
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 911, Level 16, State 1, Line 2
Database 'Accounting' does not exist. Make sure that the name is entered correctly.

I thought this would just LOAD without issue (plus, I wanted to see if anybody actually reads this stuff)....
 
Old April 9th, 2013, 01:27 AM
Wrox Author
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default Running .sql file of page 182

Good evening!

Yes, I do read this forum...now. I hadn't set up notifications until recently, but now I think I'll get pinged when folks post here. Thanks for your note - it looks like it's working.

Anyway, I wonder whether I've spotted the problem. When I look at the error you pasted in, I see a space where none should be and it's one that might possibly cause the error. In the filename, I see "AccountingC0 6Data.mdf," which should be "AccountingC06Data.mdf." So that could be it, or else it's possible the path "
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA" genuinely doesn't exist on your machine.

Have a look at those and let me know whether you still have an issue. If the download has that extraneous space in it then I'll get that corrected.

Thanks, and enjoy the book!

Paul
The Following User Says Thank You to patkinson For This Useful Post:
jminatel (April 9th, 2013)
 
Old April 9th, 2013, 05:49 PM
Authorized User
 
Join Date: Jan 2013
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Still an oops

I looked at the "path" (which appears to be the issue as I verified by typing in the .sql code -- where naturally, it crashed after the "CREATE DATABASE Accounting.....GO") -- I'm assuming at this point it's me (after all, I'm really an Oracle guy -- and SQL Server 2012 tools are a new thing for me) I'll keep pressing on this (in between my Oracle tasks) and report back -- AND, I have a number of students, much brighter than I -- maybe THEY'll post their positive results as well.....sidjack
 
Old April 9th, 2013, 05:53 PM
Wrox Author
 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

There are still a couple things that could be wrong...permission to the listed folder, for example, might be an issue. Try creating a folder of your own (anywhere is fine, really) and replacing the path in the code with a path to your folder. Once created, the database keeps track of where its data file is located so you shouldn't have any more issues even if you put it somewhere completely different.
 
Old April 10th, 2013, 12:42 PM
Authorized User
 
Join Date: Jan 2013
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Talking It worked!

Paul; did as you suggested and created my own folder, changed the path in your Chapter06AccountingDB.sql file -- ran (nothing like the sweet smell of success)
thanks

sidejack





Similar Threads
Thread Thread Starter Forum Replies Last Post
About code on page 182 40tude BOOK: Professional C++, 2nd Edition 2 March 4th, 2012 11:30 AM
Get a blank white page in Explorer when running test file AdamEmeryBrown Beginning PHP 1 December 13th, 2009 09:59 PM
On page 182 tedr BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 0 March 28th, 2009 07:19 PM
Urgent: word file on aspx page from sql server bijgupt ASP.NET 1.0 and 1.1 Professional 5 November 15th, 2006 07:27 AM
Errata page 182 tpangborn BOOK: Ivor Horton's Beginning Visual C++ 2005 0 May 21st, 2006 09:19 PM





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