Error when attaching a database to SQL Server. EventID 3415 in Event Viewer or Error 5123 in SQL Server Management Studio

If you see any of the following two errors when you attach a database to an SQL instance:

ERROR 1:

TITLE: Microsoft SQL Server Management Studio

——————————

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

——————————
ADDITIONAL INFORMATION:

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

——————————

CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105) while attempting to open or create the physical file ‘E:\_restore\MSSQL10_50.SHAREP\MSSQL\DATA\UPSA_Social.mdf’. (Microsoft SQL Server, Error: 5123)

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

——————————
BUTTONS:

OK
——————————

ERROR 2:

Event ID: 3415 

Source: MSSQLServer

Level: Error

Text:

“Database ‘Your database’ cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.”

Then you should know it has nothing to do with the permissions to the database files you try to add, it is only because you need to start SQL Server Management Studio as administrator(Right click and select Run as Administrator).

Take a look at the error messages below.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s