Df not updating

Rated 4.58/5 based on 585 customer reviews

Customer Report drop constraint ' @default_name)goalter table dbo.Customer Report]go One thing to be aware of is that since DEFAULTs are implemented as constraints, any need to change a column's datatype or need to drop the column entirely will require a DROP of any DEFAULT constraint on the column prior to your action.

I have a DEFAULT defined on a table column and I have to create a script to update this DEFAULT to reflect a change in business requirements.

My recommendation is to use INFORMATION_SCHEMA views whenever possible when working with database objects and to avoid reading system tables whenever you can.

My reasoning is that the SQL Server system catalogs can be (and have been) changed from release to release.

As a result, you cannot rely on using an an auto-generated name statically within a static DROP CONSTRAINT statement.

In these cases, the only way to modify DEFAULT constraints with auto-generated names is to capture the name from SQL Server's system catalog and to run a dynamic SQL query to perform the DROP.

Leave a Reply