Commit creating new instances of a function V2, V21, V23 etc

edited June 22, 2016 3:36AM in SQL Source Control
Commit creating new instances of a function and causing errors with duplicate definitions.

In our DB unfortunately we have scalar-valued functions with the naming convention of dbo.f_nameoffunction
Recently we had someone name a back up of 1 function to dbo.f_nameoffunctionV2.

and so on after each commit..

But I see after the commit it created a new instance names dbo.f_nameoffunctionV21..V22.. and so on each time and reported errors of duplicate functions.

Is this a naming convention rule where it creates a new object if underscore is used? or the V2?



  • Thanks for contacting us and sorry you are having this issue!

    If you created objects named dbo.f_nameoffunctionV2, dbo.f_nameoffunctionV21, dbo.f_nameoffunctionV22, dbo.f_nameoffunctionV23 etc on the database It sounds like it would create an object for each of those - so each commit would not replace/edit the object, but create a new object alongside it.

    I am not sure why there would be a duplicate object, unless someone manually put one in the repository without changing the object name in the Create script- Source Control will not allow you to commit an object with a duplicate Create script and neither will SQL Server.
    Did your colleague manually put/edited those scripts in the Source Control repository?

    Thanks for your help!
    Andrew Pierce
    Technical Sales Engineer
    Redgate Software
  • We didn't create the extra functions V21, V22 , V23 and V24.
    When I committed the original functionnameV2 it did not edit the source control file functionnameV2 but instead created a new object functionnameV21 that does not exist on the database.

    This might be related with a bug that has been reported on ticket #68141.

    The commit is failing completely as it it corrupting the SQL syntax in randomly selected source control files. If I correct these in Tortoise it will then randomly corrupt another stored procedure or function.

    Can I rename the original source control repository file (after unlinking) and create a fresh repository to start from scratch retaining the old as a back up?


    Sorry we're on Source Control 4.
    Do you want to move this thread?
Sign In or Register to comment.