Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

sp_dropdevice (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Drops a database device or backup device from an instance of the SQL Server 2005 Database Engine, deleting the entry from master.dbo.sysdevices.

Applies to: SQL Server (SQL Server 2008 through current version).

Topic link icon Transact-SQL Syntax Conventions

sp_dropdevice [ @logicalname = ] 'device' 
    [ , [ @delfile = ] 'delfile' ]

[ @logicalname= ] 'device'

Is the logical name of the database device or backup device as listed in master.dbo.sysdevices.name. device is sysname, with no default.

[ @delfile= ] 'delfile'

Specifies whether the physical backup device file should be deleted. delfile is varchar(7). If specified as DELFILE, the physical backup device disk file is deleted.

0 (success) or 1 (failure)

sp_dropdevice cannot be used inside a transaction.

Requires membership in the diskadmin fixed server role.

The following example drops the tapedump1 tape dump device from the Database Engine.

EXEC sp_dropdevice 'tapedump1';

Community Additions

© 2015 Microsoft