[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Error restoring database in SQL Express 2005

Posted on 2007-07-24
3
Medium Priority
?
1,553 Views
Last Modified: 2008-01-09
I'm receiving an error trying to restore from a backup .bak file. I originally created this database withing Visual Studio 2005 IDE and then attached it to the SQL Express, made a backup, and now I'm trying to restore it to a proper database instead of being attached to VS.

Here is the error I'm receiving.

TITLE: Microsoft SQL Server Management Studio Express
------------------------------

Restore failed for Server 'DWEBSTER2K3\SQLEXPRESS'.  (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Archive.mdf'. (Microsoft.SqlServer.Express.Smo)

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

------------------------------
BUTTONS:

OK
------------------------------

Thanks!
0
Comment
Question by:ApexCo
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
David Todd earned 500 total points
ID: 19561389
Hi,

Did you specify the locations for each of the data and log files? Most likely on a production server, the SQL service doesn't have write access to C:\. This is a good thing imho, as it has stopped you dumping a database into the root directory on the boot drive. Think about where the data file should go.

Regards
  David
0
 
LVL 8

Author Comment

by:ApexCo
ID: 19588222
Well, this database was in the App_Code folder on the asp.net project, so I attached it to the SQL Express management piece and then did a backup.

Now whenever I try to restore that file to my development machine I'm receiving that error, doesn't really matter where I place the backup.
0
 
LVL 8

Author Comment

by:ApexCo
ID: 19588272
I didn't realize that it was attempting to restore it to some place that didn't exist. I pointed it to a folder and had it create the file, problem solved.

Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question