Home » SQL ServerRSS

Operating System Error 5

Hello All,

I am attempting to add a database to Server Management Studio and encounter this error.  I am using SQL 2008 for Developers.  Would someone please suggest how I work around this:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Attach database failed for Server 'HFINNY-PC'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.2531.0+((Katmai_PCU_Main).090329-1045+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file "D:\Murach C#\Murack C#\Database\MMABooks_log.ldf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.00.2531&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

 

3 Answers Found

 

Answer 1

Hi

The error 5 is an "access denied" error.
You may need to use an admin account to actually change the security on the file such that the sql server process can open it.For your data_file.mdf diretory, make sure the user security group has write and create data permission.

or

If you work with Vista, run SQL Server "as Administrator" to launch SQL Server Management Studio.

-Sreekar
 

Answer 2

option 2 worked. Thank you!!!  I am running Vista and running as the administrator worked.
 

Answer 3

Hi

The error 5 is an "access denied" error.
You may need to use an admin account to actually change the security on the file such that the sql server process can open it.For your data_file.mdf diretory, make sure the user security group has write and create data permission.

or

If you work with Vista, run SQL Server "as Administrator" to launch SQL Server Management Studio.

-Sreekar

I followed you and got the reason. Thanks a lot.
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter