• Why not combine not updating the time in DOB with this?

    IF UPDATE(DOB)

    BEGIN

    UPDATE P

    SET DOB = dbo.fn_ReplaceTimeInDate(i.DOB)

    FROM dbo.Patient P INNER JOIN

    inserted i ON

    P.PatientID = i.PatientID

    where i.DOB <> cast(convert(varchar,i.DOB,112) as datetime)

    SET @error_var = @@ERROR

    --Error checking

    IF @error_var > 0

    GOTO rollback_tran

    END