The or replace clause allows you to replace a default's definition using create default.
Changes are in bold.
create [or replace] [owner.] default_name as constant_expression
create default phonedflt as "UNKNOWN" select object_id("phonedflt") ----------- 1001051571
create or replace default phonedflt as "999-999-9999" select object_id("phonedflt") ----------- 1001051571
Procedures that access these columns will be recompiled when the default is replaced and the procedure is executed.
Any user who impersonates the default owner through an alias or setuser cannot replace the default.
Changes for replacing a default are in bold.
Granular permissions enabled | With granular permissions enabled, you must have the create default privilege. To create a default for another user, you must have the create any default privilege. You must be the default owner to replace the default. |
Granular permissions disabled | With granular permissions disabled, you must be the database owner, a user with sa_role, or have the create default privilege. You must be the default owner to replace the default. |
Changes are in bold.
Event | Audit Option | Command or access audited | Information in extrainfo |
---|---|---|---|
14 | create | create default |
|