Undelete a Group,  Error: Cannot insert duplicate key row in object 'dbo.tps_group' with unique index 'index$tps_group$name'.

Version 2



    I have deleted a Group in Console but would still like to use this, how can I make it show again?

    If I create a new Group with the same name I get this error message:


    duplicated group.jpg






    When a Group is being deleted from Console it will only even be soft deleted, meaning it will still exist in the database.

    Because of this it cannot create a new Group with the same name, as this will then be a duplicate of the already existing Group and the Name value in the Group table needs to be unique.


    The solution is therefore to undelete the Group directly in the database using the following script:



    update tps_group set tps_deleted = '0' where tps_name = 'XXXX'


    (Please modify the script with the relevant Name of the Group)



    If you would like to still have a new Group but with the same name my suggestion would be to change the name of the old Group. You can do this by running the above script, making the Group showing in Console first, change the Name on the Group in Console and then delete the Group again. You will then be free to create a new Group using the original name.