IF EXISTS
(
    SELECT *
    FROM   SYS.COLUMNS
    WHERE  NAME = 'cd_prod'
           AND object_id = OBJECT_ID('EST_PROD_REM_PRE_VENC_IT_LOTE')
)
    BEGIN
        DECLARE @sql VARCHAR(500);
        DECLARE @constraint_name VARCHAR(100);
        SET @constraint_name =
        (
            SELECT DEFAULT_CONSTRAINTS.NAME
            FROM   SYS.ALL_COLUMNS
                   INNER JOIN SYS.TABLES ON ALL_COLUMNS.OBJECT_ID = TABLES.OBJECT_ID
                   INNER JOIN SYS.SCHEMAS ON TABLES.SCHEMA_ID = SCHEMAS.SCHEMA_ID
                   INNER JOIN SYS.DEFAULT_CONSTRAINTS ON ALL_COLUMNS.DEFAULT_OBJECT_ID = DEFAULT_CONSTRAINTS.OBJECT_ID
            WHERE  TABLES.NAME = 'EST_PROD_REM_PRE_VENC_IT_LOTE'
                   AND ALL_COLUMNS.NAME = 'cd_prod'
        );
        SET @sql = 'ALTER TABLE EST_PROD_REM_PRE_VENC_IT_LOTE DROP CONSTRAINT '+@CONSTRAINT_NAME;
        EXECUTE (@SQL);
        ALTER TABLE EST_PROD_REM_PRE_VENC_IT_LOTE DROP COLUMN CD_PROD;
        --SELECT @SQL
    END;