Removes a SQL Server database device or dump device.
sp_dropdevice logical_name [, DELFILE]
where
The sp_dropdevice system stored procedure drops a database device or dump device from SQL Server, deleting the entry from master.dbo.sysdevices. It frees the file handle and the device number when a database device is dropped. This means that the physical file can be deleted without shutting down SQL Server. To delete the physical file, use the DELFILE option or delete the file from the command line.
Note You can also immediately use the DISK INIT statement to create a new device with that same device number, logical name, and physical name (if you've deleted the file).
Execute permission defaults to the system administrator and cannot be transferred.
master.dbo.sysdatabases, master.dbo.sysdevices, master.dbo.sysusages
This example drops the TAPEDUMP1 tape dump device from SQL Server.
sp_dropdevice TAPEDUMP1
DROP DATABASE | sp_helpdb |
sp_addumpdevice | sp_helpdevice |