patternMinor
Why do I have to drop a snapshot in SQL Server 2012 to restore a database?
Viewed 0 times
why2012sqlrestoredatabasedropsnapshotserverhave
Problem
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?
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?
Solution
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.)
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.)
Context
StackExchange Database Administrators Q#33031, answer score: 6
Revisions (0)
No revisions yet.