Error when restoring a .bak file in SQL Server

Tags:
Backup and Recovery
SQL Server backup
SQL Server errors
I’m having a problem restoring a .bak file in SQL Server. The .bak file is fine and good. But when I restore it, I get an error. It says " TITLE: Restore failed for Server <servername>(Microsoft.SqlServer.Smo) ------------------------------ ADDITIONAL INFORMATION: System.Data.SqlClient.SqlError: Directory lookup for the file "C:Temp<databasename>.mdf" failed with the operating system error 2(The system cannot find the file specified.). (Microsoft.SqlServer.Smo) My OS is in D drive. What should I do to restore the database successfully?

Answer Wiki

Thanks. We'll let you know when a new response is added.

How did you restore the database, with T-SQL command or through SSMS? This error is likely to occur when network is unstable. But in your case it looks you’re restoring a local database to the same server from a local backup. Have you checked the path and the “replace” option? If you used SSMS, please post your input in the restore dialogue window.

In my case it was restore path issue. The folder I mentioned had not existed (had space in name I mentioned)

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following