Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 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 Search this Thread Display Modes
  #1 (permalink)  
Old April 8th, 2013, 01:09 PM
Authorized User
Points: 41, Level: 1
Points: 41, Level: 1 Points: 41, Level: 1 Points: 41, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Location: Great Wet Northwest
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)....
Reply With Quote
  #2 (permalink)  
Old April 9th, 2013, 01:27 AM
Wrox Author
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2012
Location: Portland, OR
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
Reply With Quote
The Following User Says Thank You to patkinson For This Useful Post:
jminatel (April 9th, 2013)
  #3 (permalink)  
Old April 9th, 2013, 05:49 PM
Authorized User
Points: 41, Level: 1
Points: 41, Level: 1 Points: 41, Level: 1 Points: 41, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Location: Great Wet Northwest
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
Reply With Quote
  #4 (permalink)  
Old April 9th, 2013, 05:53 PM
Wrox Author
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2012
Location: Portland, OR
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.
Reply With Quote
  #5 (permalink)  
Old April 10th, 2013, 12:42 PM
Authorized User
Points: 41, Level: 1
Points: 41, Level: 1 Points: 41, Level: 1 Points: 41, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Location: Great Wet Northwest
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
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



All times are GMT -4. The time now is 11:51 PM.


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