Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Database directory change error

Author  Topic 

xp_vista007
Starting Member

6 Posts

Posted - 2011-02-09 : 04:23:05
Hi. I have installed SQL 2005, it starts very well, but i cant create database in other locations just in SQL location, and i cant copy databases .
I use XP sp2.

What is a problem , can anyone tell me ?

ZZartin
Starting Member

30 Posts

Posted - 2011-02-09 : 13:13:32
What exactly are you trying to do? You should be able to create a new database on any drive the SQL Server has access to assuming there is sufficient space available.
Go to Top of Page

xp_vista007
Starting Member

6 Posts

Posted - 2011-02-09 : 16:11:05
When i try to create a database in other locations(ex. in local disc D:)
it appears a error :
Create failed for database 'example', (Microsoft.SqlServer.Express.Smo)

Additional information:
An exception ocurred while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.Express.ConnectionInfo)

CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

CREATE FILE encountered operating system error 5(Access is denied.)while attempting to open or create the physicalfile 'D:\example.mdf'.(Microsoft SQL server, ErrorL 1802).



Do you understand ?
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-02-09 : 19:12:41
Simple, the error tells you exactly what the problem is. The account running SQL Server does not have permissions to create a file in that location (Access is denied).

Identify the account running SQL Server and grant permissions on the folders where you want to put the database files.

Jeff
Go to Top of Page

xp_vista007
Starting Member

6 Posts

Posted - 2011-02-10 : 08:31:59
How to do that ???

Sorry for my amateur questions, i am a beginner .
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2011-02-10 : 16:08:43
First, identify the account running SQL Server. This can be done using the services applet (services.msc) or using SQL Server Configuration Manager. Once you have that identified, navigate to the directory where you want to place SQL Server database files. Right-click on that folder and select Properties and select the Security tab.

In the security tab, add the user running SQL Server and grant that user full access.

Since you are using XP - I am wondering if you are connecting to a server instance or a local instance of SQL Server. If you are connecting to a server instance, you need to RDP to the server and setup the rights on the server.

Jeff
Go to Top of Page

xp_vista007
Starting Member

6 Posts

Posted - 2011-02-14 : 12:49:43
Thank you so much Jeff. I finnished it.

Thanks again.
Go to Top of Page
   

- Advertisement -