Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 2.22 KB

drop-queue-transact-sql.md

File metadata and controls

69 lines (53 loc) · 2.22 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
DROP QUEUE (Transact-SQL)
DROP QUEUE (Transact-SQL)
WilliamDAssafMSFT
wiassaf
03/06/2017
sql
t-sql
reference
DROP QUEUE
DROP_QUEUE_TSQL
dropping queues
queues [Service Broker], removing
deleting queues
DROP QUEUE statement
removing queues
TSQL

DROP QUEUE (Transact-SQL)

[!INCLUDE SQL Server - ASDBMI]

Drops an existing queue.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

DROP QUEUE <object>  
[ ; ]  
  
<object> ::=  
{ database_name.schema_name.queue_name | schema_name.queue_name | queue_name }

[!INCLUDEsql-server-tsql-previous-offline-documentation]

Arguments

database_name
The name of the database that contains the queue to drop. When no database_name is provided, defaults to the current database.

schema_name (object)
The name of the schema that owns the queue to drop. When no schema_name is provided, defaults to the default schema for the current user.

queue_name
The name of the queue to drop.

Remarks

You cannot drop a queue if any services refer to the queue.

Permissions

Permission for dropping a queue defaults to the owner of the queue, members of the db_ddladmin or db_owner fixed database roles, and members of the sysadmin fixed server role.

Examples

The following example drops the ExpenseQueue queue from the current database.

DROP QUEUE ExpenseQueue ;  

See Also

CREATE QUEUE (Transact-SQL)
ALTER QUEUE (Transact-SQL)
EVENTDATA (Transact-SQL)