Column already has a DEFAULT bound to it.

Error Message:
Msg 1781, Level 16, State 1, Line 1
Column already has a DEFAULT bound to it.

Severity level:
16.

Description:
This error message appears when you try to create a DEFAULTconstraint for a column, for which already a DEFAULT constraint was declared.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Error of the Severity level 16 are generated by the user and can be fixed by the SQL Server user. There can only be one DEFAULT constraint for each column.

Versions:
All versions of SQL Server.

Example(s):
CREATE TABLE t
(
 c1 INT DEFAULT 0
)
GO
ALTER TABLE t
 ADD CONSTRAINT DF_c1 DEFAULT (1) FOR c1
DROP TABLE t

Remarks:
It is not possible to create more than 1 DEFAULT constraint for a single column. No matter if you try to do so directly in the CREATE TABLE statement or afterwards via ALTER TABLE. However, if you try to do so in a CREATE TABLE statement, SQL Server raises error 8148.

]]>

Leave a comment

Your email address will not be published.