What are the challenges you face when working across database platforms? Take the survey
Options

SQL Change Automation: Build Error (v3.0.4)

I've posted this question before but can't find the solution...so here it goes again...

I'm getting the following error during our build process: 'Cannot ALTER because it is being referenced by object'

I've looked at previous post regarding this and some indicate this has been fixed. We are using DLM Automation v3.0.4. the error is on a function that is referenced in a column constraint. We've tried the following option with no luck. SQLCompareOptions: ich

Any help would be appreciated. 

TIA,
David
Tagged:

Answers

  • Options
    Do you have a repro with the specific objects? Is this a SQL Source Control Project or an SCA/Visual Studio project?
  • Options
    DavidWNAZDavidWNAZ Posts: 20 Bronze 1
    Yes, the repo has all the required objects.  It is a SQL Source control project.
  • Options
    Can you show a repro of the code? I assume you removed the check constraint and then altered the function. Is that correct?

    There is a chronology here. In your production db, you'll need to do the same thing. When the build process works, it uses SQL Compare, which sees the function change, but isn't picking up the binding on the CHECK constraint. I think this is a bug, so I'll file this with a repro to see if they can correct this.

    For now, I'd say that you need a one time migration script, or pre/post scripts that remove the CHECK and add it back at the end around the alter function.

  • Options
    way0utwestway0utwest Posts: 313 Rose Gold 1
    edited January 16, 2019 10:18PM
    In my repro, the build succeeds, as this should be to a blank db and the dependencies should be chained. Is this failing in build or some release/update?

    My release also succeeds, so I'd like to know what repro might work for me.
Sign In or Register to comment.