(In cluster environments) Places a local system temporary database in the drop state.
sp_tempdb_markdrop database_name [, {'mark' | 'unmark'}]
is the name of the local system temporary database you are dropping
marks the specified database for dropping.
clears the mark from the database.
Marks a local system temporary database named “old_cluster_tempdb1” to be dropped:
sp_tempdb_markdrop 'old_cluster_tempdb1', 'mark'
Removes the mark from the local system temporary database “old_cluster_tempdb1”:
sp_tempdb_markdrop 'old_cluster_tempdb1, 'unmark'
To delete the last local temporary database:
Use sp_tempdb_markdrop to place the local system temporary database in the drop state.
Shut down and restart the instance that owns the last local temporary database.
After 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.
Use drop database to delete the last local system temporary database.
The permission checks for sp_tempdb_markup differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be a user with the own database privilegeon the specified database or the manage cluster privilege. |
Granular permissions disabled |
With granular permissions disabled, you must be the database owner or a user with sa_role. |