O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Removing a Database Snapshot

If you want to get rid of a snapshot or overlay a current snapshot with a more up-to-date snapshot, you simply use the DROP DATABASE command and then create it again. The DROP DATABASE command immediately removes the database snapshot entry and all sparse file allocations associated with the snapshot. It’s very simple indeed. The following example drops the database snapshot just created:

Use [master]goDROP DATABASE AdventureWorks2012_6AM_snapshotgo

If you want, you can also drop (delete) a database snapshot from SQL Server Management Studio by right-clicking the database snapshot entry and choosing the Delete option. However, it’s best to do everything with scripts so that you can accurately ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required