Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Creating Database: Error Message. Expand / Collapse
Author
Message
Posted Thursday, September 12, 2013 8:45 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
 CREATE DATABASE ApressFinancial ON PRIMARY
( NAME = N'ApressFinancial',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\ApressFinancial.mdf' , Size = 3072KB, Maxsize = Unlimited, FILEGROWTH = 1024KB )
LOG ON
(Name = N'ApressFinancial_log',
FileName= N' C:\Program files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\ApressFinancial_log.ldf', Size = 1024KB, Maxsize = 2048GB, FILEGROWTH = 10%)
Collate SQL_Latin1_General_CP1_CI_AS
go

Getting an error message that says:



Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\ApressFinancial.mdf" failed with the operating system error 3(The system cannot find the path specified.).
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.


Post #1494223
Posted Thursday, September 12, 2013 9:03 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
I have admin rights and I have verified and re-verified the file path is correct but still dont understand why I would get this error.
Post #1494235
Posted Thursday, September 12, 2013 9:24 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 5:55 PM
Points: 896, Visits: 7,087
The create database is run in the context of the account under which the sql sever is running. Check the permissions for that account, not your account.



And then again, I might be wrong ...
David Webb
Post #1494245
Posted Thursday, September 12, 2013 9:36 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
OK... for some reason I am drawing a complete blank.... How do I check the permissions for the account that is running the instance of SQL Server?
Post #1494251
Posted Thursday, September 12, 2013 10:06 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 3:21 PM
Points: 13,083, Visits: 11,918
todd.ayers (9/12/2013)
I have admin rights and I have verified and re-verified the file path is correct but still dont understand why I would get this error.


Are you sure??? That is VERY close to the default but not quite...

C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA

Notice the "_50"


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1494270
Posted Thursday, September 12, 2013 10:29 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
Yeah... I'm pretty sure.... As a matter of fact this example database that I am creating comes from a book I am going through (Beginning SQL Server 2008 for Developers: From Novice to Professional)

Now I can right click on the Databases container in the Object Explorer and create a new Database that way with no issues. but using the Query Editor will not work for me...
Post #1494281
Posted Thursday, September 12, 2013 10:37 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 3:21 PM
Points: 13,083, Visits: 11,918
todd.ayers (9/12/2013)
Yeah... I'm pretty sure.... As a matter of fact this example database that I am creating comes from a book I am going through (Beginning SQL Server 2008 for Developers: From Novice to Professional)

Now I can right click on the Databases container in the Object Explorer and create a new Database that way with no issues. but using the Query Editor will not work for me...


If you can create a new database in the gui but not in a query window then it pretty much has to be the path. Try copying that path to the clipboard and pasting it into a windows explorer title bar.

Or run this query.

select * from sys.database_files

Copy the path from physical_name and paste it into your query. My money is that you have a typo. This isn't a permissions issue. The error message expressly states that it can't find the path.


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1494285
Posted Thursday, September 12, 2013 2:07 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 15, 2014 1:56 PM
Points: 59, Visits: 120
I finally got it to work... thx for all your help guys...
Post #1494354
Posted Thursday, September 12, 2013 2:26 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 3:21 PM
Points: 13,083, Visits: 11,918
todd.ayers (9/12/2013)
I finally got it to work... thx for all your help guys...


Glad you got it to work. What was the issue? There may be others who come along this thread in the future and it would be great if you can post what worked for you.


_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1494364
Posted Thursday, September 12, 2013 6:32 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, July 17, 2014 3:19 PM
Points: 975, Visits: 3,342
That is one reason that I never use that Directory. I always use a directory on different drives.

Like "SQL 2008 Databases\[DatabaseName]"

I have never liked that directory of Program Files. I never even use it when I install software.

Andrew SQLDBA
Post #1494410
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse