Restore issue

Silas2
Silas2 used Ask the Experts™
on
SQL 2012 , I think I have an express install (doesn't say in @@version) and i'm trying to restore a db from a full version, I don't know if that's germane to the issue....but when I run :
USE [master]
RESTORE DATABASE [WebCMMS_DEV_EDFWB] 
From Disk=N'C:\DownloadedToKeep\EncaData\WebCMMS_DEV_EDFWB.bak'
WITH  FILE = 1,  
MOVE N'EDF_WBTQ4_7_9_8' TO N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\WebCMMS_DEV_EDFWB.mdf',  
MOVE N'EDF_WBTQ4_7_9_8_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\WebCMMS_DEV_EDFWB_log.ldf',  
NOUNLOAD,  REPLACE,  STATS = 1
GO

Open in new window

I've got the list of files from running "restore filelistonly " , but the error i'm getting is :
The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\WebCMMS_DEV_EDFWB.mdf'.
(The db doesn't exist on the target server....should it?)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior DBA
Most Valuable Expert 2018
Top Expert 2014
Commented:
That's usually a permissions error.  The account running SQL Server doesn't have permission to write to that directory.

Author

Commented:
Thanks, that does seem to be running now.
I'm restoring to a non-program files folder, does SQL server mind that?
Brian CroweDatabase Administrator
Top Expert 2005

Commented:
You just need to give the user that your SQL Server service is running under access to whatever folder you want to use.
Top Expert 2012

Commented:
SQL 2012 , I think I have an express install (doesn't say in @@version)
Do it this way:
SELECT SERVERPROPERTY('Edition')

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial