sp_unbindefault

Unbinds a created default value from a column or from a user-defined datatype.

Syntax

sp_unbindefault objname [, futureonly]

Parameters

Examples

Usage

There are additional considerations when using sp_unbindefault:
  • Use sp_unbindefault to remove defaults created with sp_bindefault. Use alter table to drop defaults declared using the create table or alter table statements.

  • Columns of a user-defined datatype lose their current default unless the default has been changed or the value of the optional second parameter is futureonly.

  • To display the text of a default, execute sp_helptext with the default name as the parameter.

See also create default, drop default in Reference Manual: Commands.

Permissions

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

SettingDescription
Enabled

With granular permissions enabled, you must be the object owner or the user datatype owner.

Disabled

With granular permissions disabled, you must be the object owner.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

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

InformationValues
Event

67

Audit option

unbind

Command or access audited

sp_unbindefault

Information in extrainfo
  • 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 in effect

Related reference
sp_bindefault
sp_helptext