Check contraints

crimdoncrimdon Posts: 54 Bronze 3
edited August 24, 2016 6:39AM in SQL CI 2
I have some tables with static data that we include in source control. I have now added check constraints to the effective date on these tables.

As this was causing sqlCI.exe to fail building a package, I added the option to ignore check constraints. I now get the following error:

Error: Synchronization of 'Scripts.state' and

2016-07-20T14:43:42.0010511Z 'xxx.sqlCI_0427e088-7605-4ea5-ae20-b66aa22ab07e' failed:

2016-07-20T14:43:42.0010511Z 'CHK_PostcodeAreaRate_EffectiveDate' is not a constraint. Could not drop

2016-07-20T14:43:42.0010511Z constraint. See previous errors. Error executing the following SQL: ALTER TABLE

2016-07-20T14:43:42.0020513Z [dbo].[PostcodeAreaRate] DROP CONSTRAINT [CHK_PostcodeAreaRate_EffectiveDate]

Has anyone any ideas?


Regards


Andrew Lackenby

Comments

  • Hi Andrew,

    I'm going to create a support ticket for this issue. You should receive an email shortly.
    Software Engineer
    Redgate Software
  • crimdoncrimdon Posts: 54 Bronze 3
    Hi Rob,

    Sorry I've been away for a couple of weeks but had a chance to look at this again today.

    I ran profiler on the server while the build was running and what appears to be happening is:

    Table is created in temp db (without constraint)

    PK is added to table

    Alter table with drop constraint fails (as constraint was never created in first place)

    The arguments for sqlCI.exe I'm using are:

    Build /packageId=CCV /packageVersion=$(Build.BuildNumber) /scriptsFolder=. /temporaryDatabaseServer=buildServer /dlmDashboardHost=tfs /additionalCompareArgs=" /Options:IgnoreChecks

    Andrew
  • Hi Andrew,

    I've created a new support ticket for you. You'll get an email very shortly.
    Software Engineer
    Redgate Software
Sign In or Register to comment.