sp_dropdevice (Transact-SQL)sp_dropdevice (Transact-SQL)

适用于: 是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: YesSQL Server NoAzure SQL Database NoAzure Synapse Analytics (SQL DW) NoParallel Data Warehouse

从实例中删除数据库设备或备份设备SQL Server 2005 数据库引擎SQL Server 2005 Database Engine,并从sysdevices中删除该条目。Drops a database device or backup device from an instance of the SQL Server 2005 数据库引擎SQL Server 2005 Database Engine, deleting the entry from master.dbo.sysdevices.

主题链接图标 Transact-SQL 语法约定Topic link icon Transact-SQL Syntax Conventions

语法Syntax

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

参数Arguments

[ @logicalname = ] 'device'master.dbo.sysdevices.name中列出的数据库设备或备份设备的逻辑名称。[ @logicalname = ] 'device' Is the logical name of the database device or backup device as listed in master.dbo.sysdevices.name. 设备sysname,无默认值。device is sysname, with no default.

[ @delfile = ] 'delfile'指定是否应删除物理备份设备文件。[ @delfile = ] 'delfile' Specifies whether the physical backup device file should be deleted. delfilevarchar (7)delfile is varchar(7). 如果指定为DELFILE,则删除物理备份设备磁盘文件。If specified as DELFILE, the physical backup device disk file is deleted.

返回代码值Return Code Values

0(成功)或 1(失败)0 (success) or 1 (failure)

结果集Result Sets

None

备注Remarks

不能在事务内使用sp_dropdevicesp_dropdevice cannot be used inside a transaction.

权限Permissions

要求具有 diskadmin 固定服务器角色中的成员身份。Requires membership in the diskadmin fixed server role.

示例Examples

下面的示例从tapedump1中除去 数据库引擎Database Engine 磁带转储设备。The following example drops the tapedump1 tape dump device from the 数据库引擎Database Engine.

EXEC sp_dropdevice 'tapedump1';  

另请参阅See also

备份设备 (SQL Server) Backup Devices (SQL Server)
删除备份设备 (SQL Server) Delete a Backup Device (SQL Server)
sp_addumpdevice (Transact-SQL) sp_addumpdevice (Transact-SQL)
sp_helpdb (Transact-sql) sp_helpdb (Transact-SQL)
sp_helpdevice (Transact-sql) sp_helpdevice (Transact-SQL)
系统存储过程 (Transact-SQL)System Stored Procedures (Transact-SQL)