A duplicate definition was found for the column

I am getting an error (copied below) popup on SQL Source Control. I modified the object recently. I am not sure what this error is about. Please guide what needs to be done,

A duplicate definition was found for the column '[dbo].[PolicyMaster].[policyID]'.

Ensure that case sensitivity options are set correctly and all object creation scripts are valid.If the problem persists, contact Redgate support.


  • Hi @Dkaur

    Sorry to hear you're experiencing this issue, it can be quite common.

    In order to troubleshoot this I would need some more information from you, what I'll do is reach out to you via a support ticket and we can go from there!

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our Help Center?

  • Ed_KiernerEd_Kierner Posts: 3 New member

    Hi DanC

    I am having a similar issue as Dkaur, except my issue references a Table.  Many of the tables in the system are drop/created, and it often takes a few minutes to register the diff when using SQL Source Control.  My current assumption is that the table is being drop/created while the diff is occurring.  I have marked the table as excluded via the Setup tab, but the error continues to occur.

    Do you have any advice?

  • Hi @Ed_Kierner

    Absolutely, so to give you a brief explanation on why the error can occur and what you can do:

    The duplicate error is usually caused by unnecessary files in your repository which have resulted in duplicate CREATE statements for an object. In most cases, the files were added manually to the repository. It's important that the repository that SQL Source Control (SOC) uses doesn't contain anything else apart from files generated by SOC.

    So to start I recommend making sure you're up to date on the latest version of SQL Source Control, if the error remains: to find the offending file, you can search your repository for all the CREATE statements for the object referenced in the error. If you have Notepad++ you can use the "Search > Find in Files" option to search the folder for instances of the CREATE string or object name.

    Once you find the issue, you'll need to delete the duplicate CREATE statement from the repository and commit.

    Finally, unlink and relink the database from SOC to refresh your working copies and transient copies.

    If you have any trouble don't hesitate to contact us on support by submitting a ticket through the portal!

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our Help Center?

  • Ed_KiernerEd_Kierner Posts: 3 New member
    I am up to date on SSC and trying to commit to a new repository (the folders are empty on SVN side).  This is all while trying to pull the definitions down from the DB.  If I perform the same action with no users in the system, I can usually commit the changes just fine (confirmed by leveraging lower identical environments).  I will open a ticket through the portal as you have directed.
Sign In or Register to comment.