Competition: What’s your favorite Redgate tool? Enter now.

Column could not be matched to a column in the source table.

vbandradevbandrade Posts: 3
Hello there,

I want to use the smart rename function to rename and Identity column ([PKAAA]) of a table... the errors I´m getting are:

- The identity column on table [AAA] has changed. the table must be rebuilt. the data in the table apart from dropped columns will be preserved.

- Column [PKAAA] on table [AAA] could not be matched to a column in the source table. the data in this column will be lost

PKAAA is an Identity, auto increment 1.

What these errors mean? My application runs just fine using the table. Search for it, nothing.

More important: How do I solve these errors to make smart rename work?

Thx

Comments

  • These aren't errors they're just warnings. They are shown because the column that you're renaming is an identity column the table will need to be rebuilt. The data from the original table will be copied into a temporary table while the original table is rebuilt. Once the table has been rebuilt and the identity column renamed then the data will be copied back.

    However, the identity values in the original identity column will be dropped and recreated when the original data is inserted into the newly built table. If your identity values in the table are sequential starting 1,2,3... then this shouldn't be a problem for you and the table will be recreated as it was. The only time this may be a problem is if the identity values for some reason aren't sequential i.e. 1,2,6,3,8 and you're using them for referential integrity. It's a good idea to always check the smart rename script before executing it so that you know exactly what the script will be doing.
  • Thanks for your reply.... I checked the script and I would like to suggest a feature.

    Have a smart rename script that has only one transaction. So if anything goes wrong it rolls back all the changes.

    This is being a pain with the smart rename 'cause errors are happening a lot, and it's hard to keep track of what has changed and what's hasnt.
  • The smart rename script should have transactions all the way through it for each task. If one of these fails it will, at the end, roll-back all of the changes. There is only one commit transaction statement and this is right at the end and will be executed only if there have been no errors. So the script should not be making partial changes and leaving the database in an inconsistent state. Are you certain that there are changes being made and not rolling back on an error?
Sign In or Register to comment.