Duplicate Definition Was Found in Database Project

This has been a continual thorn in my side preventing me from utilizing SQL Compare without a lot of workarounds. SQL Database Project has a duplicate entry that occasionally gets in the XML of the project definition. This does not impact the actual release, it's just a bug in SSDT.

However, when running SQL Compare based on the database project this duplicate definition is classified as a stopping error, not a warning. This means any comparison to past source control projects in TFS fail.

To resolve I have to script a download of the changeset in question, parse via PowerShell the XML for duplicate definitions and try to clean up, which is very difficult.

Yes, it's a bug in SSDT, not your product. Yes, I'm hoping that this can be classified as a warning and if the exact same file is defined it would just care about uniqueness, not a duplicate XML entry in the resources list.

Any possibility of getting this done? It's really crippling to using SQL Compare directly with Team Foundation Server and SSDT when we've had these duplicate entries crop up time to time.

Answers

  • To be honest, I don't think this kind of error suppression would be a sensible change to make to SQL Compare, because it adds another factor our support team will have to consider when diagnosing potentially invalid scripts folders.

    However there might be a workaround that doesn't involve editing the SSDT project file. If you delete the database project file, SQL Compare will default to building a schema from all .sql files in the chosen folder (recursively). If you don't care about static data then this should be pretty straightforward.

    I'm not an expert on TFS but there might be techniques involving sparse checkouts or untracked/ignored files so that the deletion of the project file isn't reverted when you checkout a different revision.

    Hope that helps!
    Software Developer
    Redgate Software
Sign In or Register to comment.