Problem attaching adventureworksLT(sql server 2005)databases to sql server 2008
-
Wednesday, January 20, 2010 9:46 PM
when i try to attach the adventureworksLT(SQL server 2005) to SQL server 2008 it gave me the error:
Attach database failed for Server 'VALENTINO-PC'. (Microsoft.SqlServer.Smo)------------------------------
ADDITIONAL INFORMATION:An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Database 'AdventureWorksLT' cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery. (Microsoft SQL Server, Error: 3415)
All Replies
-
Friday, January 22, 2010 5:35 PMModerator
The first thing to check is the read/write property of the AdventureWorksLT.mdf and .ldf files in the folder in which you placed them.
The second thing to check is permissions on the files. Starting with SQL Server 2005, permissions are modified on the database files whenever they are detached or backed up and are restricted to the account that executed the detach or backup statement. This is described in the Books Online topic "Security Data and Log Files (http://msdn.microsoft.com/en-us/library/ms189128.aspx. It could be that the service account for your instance of SQL Server 2008 does not have permissions on the folder or files. The account must have at least Read permissions the files. If you're not sure what the account name is go to the SQL Server Configuration Manager tool.Regards,
Gail
Gail Erickson [MS] This posting is provided "AS IS" with no warranties, and confers no rights- Proposed As Answer by Ed Price - MSFTMicrosoft Employee, Owner Wednesday, November 07, 2012 9:16 PM
-
Sunday, July 04, 2010 5:51 PMModerator
The error message indicates that the AdventureWorksLT database files are set to read-only. Therefore, the first thing to check is the read/write property of the files. This involves the following steps:
1. From Windows Explorer, navigate to the location of the AdventureWorksLT database files. The default location is the DATA folder under C:\Program Files\Microsoft SQL Server.
2. Right-click the AdventureWorksLT_Data.mdf file and select Properties. If the Read-Only attribute is checked, clear the check box and click OK. Repeat this step for AdventureWorksLT_LOG.ldf and try the attach process again.
If the files were not set to read-only, then the next thing to check is which accounts have permissions on the files. It could be that the service account for your instance of SQL Server 2008 does not have permissions on the folder or files. The account must have at least Read permissions on the files. If you're not sure what the account name is go to the SQL Server Configuration Manager tool.
Gail Erickson [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights- Proposed As Answer by Ed Price - MSFTMicrosoft Employee, Owner Wednesday, November 07, 2012 9:16 PM
-
Thursday, November 18, 2010 6:36 PMhi.I think you should copy .mdf and .ldf files in folder which you installed sql server.

