Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 2.98 KB

drop-a-database-snapshot-transact-sql.md

File metadata and controls

66 lines (47 loc) · 2.98 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Drop a Database Snapshot (Transact-SQL) | Microsoft Docs
03/14/2017
sql-server-2016
database-engine
article
removing database snapshots
deleting database snapshots
database snapshots [SQL Server], deleting
ad70ec97-d5fb-41aa-b72a-915e74b61b76
36
JennieHubbard
jhubbard
jhubbard

Drop a Database Snapshot (Transact-SQL)

Dropping a database snapshot deletes the database snapshot from [!INCLUDEssNoVersion] and deletes the sparse files that are used by the snapshot. When you drop a database snapshot, all user connections to it are terminated.

Security

Permissions

Any user with DROP DATABASE permissions can drop a database snapshot.

How to Drop a Database Snapshot (Using Transact-SQL)

To drop a database snapshot

  1. Identify the database snapshot that you want to drop. You can view the snapshots on a database in [!INCLUDEssManStudioFull]. For more information, see View a Database Snapshot (SQL Server).

  2. Issue a DROP DATABASE statement, specifying the name of the database snapshot to be dropped. The syntax is as follows:

    DROP DATABASE database_snapshot_name [ ,...n ]

    Where database_snapshot_name is the name of the database snapshot to be dropped.

Example (Transact-SQL)

This example drops a database snapshot named SalesSnapshot0600, without affecting the source database.

DROP DATABASE SalesSnapshot0600 ;  

Any user connections to SalesSnapshot0600 are terminated, and all of the NTFS file system sparse files used by the snapshot are deleted.

Note

For information about the use of sparse files by database snapshots, see Database Snapshots (SQL Server).

Related Tasks

See Also

DROP DATABASE (Transact-SQL)
Database Snapshots (SQL Server)