What are the challenges you face when working across database platforms? Take the survey

RG_Recovery table

I have a build that keeps failing because it keeps trying to create a table called RG_Recovery_33_XXX when we already have a table called XXX in the database. I have no idea why the sql compare is trying to create this table. Any thoughts?


  • Options
    Hey Bernie,

    Thanks for contacting us!
    It creates recovery tables when you make a schema change that affects data, such as adding a column in the middle of a table, renaming a table, or changing a data type on a column.

    I'd have to see the full deployment script/build log to do a full diagnosis but that is a good starting point.

    I'll reach out to you via email for more info.

    Andrew Pierce
    Technical Sales Engineer
    Redgate Software
  • Options
    bernieconwaybernieconway Posts: 6 New member
    Thanks Andrew! Please contact me when you have time.
  • Options
    bernieconwaybernieconway Posts: 6 New member
    edited August 21, 2017 12:49PM
    We eventually found the issue. We had a constraint named with a period in the name i.e. [df_dbo.constraintname]. The compare does not find the constraint name when trying to delete it and blows up on trying to change the table structure.
  • Options
    ssarmadhssarmadh Posts: 3 New member
    Hello Andrew, if one table is getting changes with respect to data type change then will it also create the recovery tables for all the tables in the database which are directly or indirectly related to the affected table.
  • Options
    RichMcRichMc Posts: 1 New member
    I have a devops deployment that is failing for this reason. Redgate appears to be creating a recovery table for data that I have deleted.
    2022-05-31T15:28:36.3487277Z ##[error]Applying update script failed: 2 batches failed. The first error is 'Conversion failed when converting the varchar value '00g16mswfaoQK0W1Z0h8' to data type int.'

    2022-05-31T15:28:34.7835363Z ##[warning]The error 'Conversion failed when converting the varchar value '00g16mswfaoQK0W1Z0h8' to data type int.' occurred when executing the following SQL:
    INSERT INTO [dbo].[RG_Recovery_1_RelationshipTypeApplicationClaimsGroup]([RelationshipTypeApplicationClaimsGroupId], [RelationshipTypeApplicationId], [ClaimsGroupId]) SELECT [RelationshipTypeApplicationClaimsGroupId], [RelationshipTypeApplicationId], [ClaimsGroupId] FROM [dbo].[RelationshipTypeApplicationClaimsGroup]
    2022-05-31T15:28:35.7708703Z ##[warning]The error 'Invalid column name 'IsAdmin'.' occurred when executing the following SQL:
    PRINT(N'Drop constraints from [dbo].[RelationshipTypeApplicationClaimsGroup]')
    ALTER TABLE [dbo].[RelationshipTypeApplicationClaimsGroup] NOCHECK CONSTRAINT [FK_RelationshipTypeApplicationClaimsGroup_RelationshipTypeApplication]

    The column describe is in fact an integer. It is static data and I have verified that the data is an integer in the static table. Why is Redgate creating theis recovery table? It is not needed!

Sign In or Register to comment.