Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I never had to drop a snapshot with SQL Server 2008, but now when I try to restore in SQL Server 2012, I get the error:

System.Data.SqlClient.SqlError: The operation cannot be performed on a database with database snapshots or active DBCC replicas.

Why is this necessary in 2012 and not in 2008?

share|improve this question
add comment

migrated from stackoverflow.com Jan 16 '13 at 15:47

This question came from our site for professional and enthusiast programmers.

1 Answer

Actually, you did have to drop the snapshot before the restore. Here's the Books Online post about it:

http://msdn.microsoft.com/en-us/library/ms189940(v=sql.105).aspx

In particular, "The database cannot be dropped, detached, or restored."

You might have been using a restore script or tool that automatically dropped the snapshots for you. (My own restore database script does that - checks for snapshots first and deletes 'em.)

share|improve this answer
2  
+1 also, if you restore over a different version of the database that has a snapshot, what on earth would the snapshot be good for? It would be completely unusable. Now, it would be nice if RESTORE had an intuitive option, like WITH DROP_EXISTING_SNAPSHOTS :-) –  Aaron Bertrand Jan 16 '13 at 16:33
    
You had better have upvoted that answer and not just written +1, hahahaha.... –  Brent Ozar Jan 16 '13 at 20:27
1  
are you kidding? That's my m.o. Make people think I like what they wrote. Secretly I am planning their demise. Oh crap, is this real life? –  Aaron Bertrand Jan 16 '13 at 20:30
    
Now that I think of it, you are correct, just wasn't used to seeing that error. But, when restoring in 2012, I got the error to go away when I unchecked something about tail log backup (not sure if this is what it was called) under options. –  Xaisoft Jan 17 '13 at 5:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.