Error: Column already has a DEFAULT bound to it. Could not create constraint.


Error: Column already has a DEFAULT bound to it. Could not create constraint.

Description: The constraint trying to create for the column is already exists.

Solution: From system table sys.objects find out the constraint, rename or drop the existing constraint and then create the new one.

SELECT
      name
      ,OBJECT_NAME(parent_object_id) AS ParentTable
      ,OBJECT_NAME(object_id) AS ConstraintName
FROM sys.objects
WHERE type_desc LIKE '%CONSTRAINT'
order by name
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s