Options

I am receiving an error: A duplicate definition was found for the table. <name>

I recently started working with a database that has not had any changes in several years.
My first attempt at adding a simple column resulted in the message : A duplicate definition was found for the table <name>. Which was odd because master compiled nicely and I only wanted to add a new column.

After some research and a lot of annoyance, I have found that the work directory, transient and source folder contain an extra folder Tables which is outside of the database folder and contains the change that I want to add to source control.
The database \ Tables folder contains the original table definition.

The folder structure looks like this
.Github
Database
Database\Tables
Database\Views
Database\.... (other folders)
Tables



If I remove this folder with GitHub, the folder is removed for a few moments. Redgate is kind enough to replace the folder and the contents whenever I attempt to push the change to ensure that the Duplicate definition message remains.

I currently only have this with 1 database and would like to resolve this issue as soon as possible..
Any suggestions of how to resolve this issue?
Tagged:

Answers

  • Options
    Hello, 

    Thank you for your inquiry into SQL Source Control, we are sorry to hear it is giving you trouble.

    Regarding the duplicate definition error that is being received, the article below should help resolve this.
    https://productsupport.red-gate.com/hc/en-us/articles/4407476864401-Duplicate-definition-troubleshooting-in-SQL-Source-Control

    I hope this information helps.

    Best,

    Dustin 

  • Options
    Mark6of7Mark6of7 Posts: 2 New member
    Thanks for the information, but that does resolve the issue.

    SQL Source Control seems to be creating the folder with the duplicate object.

    Additional information:
    This folder is being created when I press [COMMIT] button.
    This folder contains the changes that should go into the branch.
    If I remove this folder or merge it into the database folder, it does NOT push the change.
    So when I disconnect and re-connect the repository, the change is lost.
  • Options
    Hi Mark, 

    Thank you for the follow-up, we are sorry to hear SQL Source Control is still giving you trouble.

    It looks like a support ticket has been created which would be my next suggestion as recommended in the linked article to look into this one a bit more in-depth.

    Best, 

    Dustin 
  • Options

    Hi Mark,

     

    Thanks for your assistance on the support ticket and glad you were able to get to a resolution with the team.

    Posting up the solution that worked in this instance in case it can be used by the community

     


    Issue resolved by removing the offending tables.

    * This was done by renaming them and treating them as if the original tables had been removed.

    * Then the renamed tables were processed into Master, they were re-named back to their original names and then added again into Master

    * Once all items were in Master, link the tables back up with the static data.

     

    Jon Kirkwood | Technical Support Engineer | Redgate Software
Sign In or Register to comment.