Thursday, September 3, 2009

Misleading SQL Error Message…

September 03, 2009 Posted by Unknown 2 comments

Tonight I was attempting to restore a SQL 2008 database from a development database to my local SQL instance.

I received the following error message:

Cannot open backup device ‘C:\backups\mydb.bak’ is incorrectly formed. Operating system error 5(Access is denied.).

RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

When I saw access denied I assumed that this was an issue with the filepath I was attempting to restore from. However, I was on a completely wrong path. The issue was far more simple – the database on my development server had SP1 installed, my development instance did not. I’m sure it is not as straightforward as I’m making it out to be but adding an appropriate error message would have been really nice!