September 12, 2013 at 8:45 am
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.
September 12, 2013 at 9:03 am
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.
September 12, 2013 at 9:24 am
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.
September 12, 2013 at 9:36 am
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?
September 12, 2013 at 10:06 am
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 Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 12, 2013 at 10:29 am
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...
September 12, 2013 at 10:37 am
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 Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 12, 2013 at 2:07 pm
I finally got it to work... thx for all your help guys...
September 12, 2013 at 2:26 pm
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 Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 12, 2013 at 6:32 pm
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
September 13, 2013 at 3:37 am
AndrewSQLDBA (9/12/2013)
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.
Same here. I install all databases (including System Databases) on other drives than C: and avoid long directory names.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply