Hi friends am droppping a column thru sql stmt and am getting following error
The object 'DF__s_datavie__Overr__1DA648AE' is dependent on column 'OverrideCol'. ALTER TABLE DROP COLUMN OverrideCol failed because one or more objects access this column.
bcoz i've a default constraint on this column my question is, how can i get list of default constraints on this column so that i can drop them first before dropping column. as you'll know that the constraint name can be different on each server having this table so i need to do this. Thanks for the ideas.
SELECT cols.name as column_name, c_obj.name as constraint_name,t_obj.name as table_name FROM sysobjects t_obj, sysobjects c_obj, syscolumns cols WHERE cols.id = t_obj.id AND c_obj.id = cols.cdefault AND c_obj.xtype = 'D'