SQL Server, Restore database fails to select backup file

I was doing some work the other day that involved backing up a database from 1 SQL instance, then restoring it to a 2nd SQL instance.

After completing the full back up i tried to run a restore task using the SQL Management Studio UI. I got the error seen in the screenshot below, every time i tried to select the back up files i had created.

SQL Restore error for blog

Baffled by this i shouted out to one of my colleagues who told me to run the following SQL query to see what would happen doing the restore manually:

RESTORE DATABASE <OperationsManager>     FROM DISK = ‘C:\DB’s to restore from’;

The instant SQL highlighted my path in red, we realised what a silly mistake i had made… It didn’t like the ‘s in the file name “DB’s to restore from”. Turns out Transact SQL doesn’t like apostrophes in the file paths.

Lesson learned.



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.