sp_tempdb_markdrop

Description

Places a local system temporary database in the drop state.

Syntax

sp_tempdb_markdrop database_name [, {'mark' | 'unmark'}]

Parameters

Examples

This example marks a local system temporary database named “old_cluster_tempdb1” to be dropped:

sp_tempdb_markdrop 'old_cluster_tempdb1', 'mark'

This example removes the mark from the local system temporary database “old_cluster_tempdb1”:

sp_tempdb_markdrop 'old_cluster_tempdb1, 'unmark'

Usage

To delete the last local temporary database:

  1. Use sp_tempdb_markdrop to place the local system temporary database in the drop state.

  2. Shut down and restart the instance that owns the last local temporary database.

    NoteAfter you mark the local system temporary database to be dropped, the owner instance restarts if there are no other active instances. This instance does not use the marked local system temporary database when it starts.

  3. Use drop database to delete the last local system temporary database.