DECLARE @tableName VARCHAR(MAX) = 'DT858'
DECLARE @columnName VARCHAR(MAX) = 'DI062362'
DECLARE @ConstraintName nvarchar(200)
SELECT @ConstraintName = Name
FROM SYS.DEFAULT_CONSTRAINTS
WHERE PARENT_OBJECT_ID = OBJECT_ID(@tableName)
AND PARENT_COLUMN_ID = (
    SELECT column_id FROM sys.columns
    WHERE NAME = @columnName AND object_id = OBJECT_ID(@tableName))
IF @ConstraintName IS NOT NULL
    EXEC('ALTER TABLE ' + @tableName + ' DROP CONSTRAINT ' + @ConstraintName);
alter table DT858 add constraint DT858DI062362_DEFAULT default 1 for DI062362;
