drop default

Description

Removes a user-defined default.

Syntax

drop default [owner.]default_name 
	[, [owner.]default_name] ...

Parameters

default_name

is the name of an existing default. Execute sp_help to display a list of existing defaults. Specify the owner’s name to drop a default of the same name owned by a different user in the current database. The default value for owner is the current user.

Examples

Example 1

Removes the user-defined default datedefault from the database:

drop default datedefault

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for drop default differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be the default owner or a user with drop any default privilege.

Granular permissions disabled

With granular permissions disabled, you must be the default owner or a user with sa_role.

drop default permission defaults to the owner of the default and is not transferable.

Auditing

Values in event and extrainfo columns of sysaudits are:

Event

Audit option

Command or access audited

Information in extrainfo

31

drop

drop default

  • Roles – current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – original login name, if set proxy is in effect

See also

Commands create default

System procedures sp_help, sp_helptext, sp_unbindefault