Razvan Socol
3/20/2007 7:08:00 AM
If you don't know the name of the default constraint (you know only
the column name), you can use something like this:
IF NOT EXISTS (
SELECT * FROM sysconstraints
WHERE id=OBJECT_ID('TableName')
AND COL_NAME(id,colid)='ColumnName'
AND OBJECTPROPERTY(constid, 'IsDefaultCnst')=1
) ...
Razvan