Reputation: 15
When I am trying to copy NEo.mdf file from E:\sql installation\MSSQL10.MSSQLSERVER\MSSQL\DATA location to another Location it give error "Access Denied" Hpw to copy tha file please help?
Upvotes: 0
Views: 1399
Reputation: 360
You need to stop the SQL Server services by running service.exe and finding services beginning with SQL Server in the list. That should solve the problem. If it doesn't, run task manager and kill the sqlservr process. Alternatively you can try detaching the database within SQL Management Studio if you cannot stop the services.
Upvotes: 0
Reputation: 45083
You will need to take the database offline first, you can do this via SQL Management Studio (assuming you're not doing this programmatically) by right-clicking the database and selecting Tasks -> Take Offline.
Upvotes: 1