DROP QUEUE (Transact-SQL)

Drops an existing queue.

Topic link iconTransact-SQL Syntax Conventions

Syntax

DROP QUEUE <object>
[ ; ]

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

Arguments

  • database_name
    Is 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)
    Is 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
    Is 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

This example drops the ExpenseQueue queue from the current database.

DROP QUEUE ExpenseQueue ;

See Also

Reference

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

Other Resources

Queues

Help and Information

Getting SQL Server 2005 Assistance