p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Microsoft SQL Server 2012 Programming (http://p2p.wrox.com/forumdisplay.php?f=681)
-   -   Running .sql file of page 182 (http://p2p.wrox.com/showthread.php?t=89806)

sidejack April 8th, 2013 01:09 PM

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)....

patkinson April 9th, 2013 01:27 AM

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

sidejack April 9th, 2013 05:49 PM

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

patkinson April 9th, 2013 05:53 PM

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.

sidejack April 10th, 2013 12:42 PM

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


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

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