How do I attach a database to an instance of SQL Server 2005 Express?
Posted on 2007-10-15
Experts: I am trying to attach the sample database AdventureWorks to an instance of SQL Server 2005 Express. Using the following code:
CREATE DATABASE AdventureWorks
ON PRIMARY (FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf')
I get a message:
Msg 5120, Level 16, State 101, Line 2
Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf". Operating system error 5: "5(Access is denied.)".
I have checked the properties of the file and it is not read only. Would appreciate your assistance.