table rename means a drop table and recreate?

5QL53rv3r5QL53rv3r Posts: 3
Hi,

I am in the process of evaluating SQL source and I have renamed a table & then went to commit the change. I noticed that SQL source wants to drop the table and the create the table with the new name. Is this how this software handles a rename?

Thanks
M

Comments

  • Yes, for the time being, a rename isn't treated in any special way so it is seen as a drop and the creation of a new object. Is there any reason why this would cause a problem for you?

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • will data be lost from the tables or is the data copied to temp tables and then inserted into the renamed table. so it looks like sp_rename isn't used.
  • Yes, if you get latest, data will be lost as we don't know that the rename has occurred. This would be a good reason to save the 'intent' of the change alongside it, and use a smart rename rather than a drop/create.

    Thanks for bringing this to our attention. In the meantime, instead of using get latest for this change, you'll have to make a manual change locally with your won rename script (you can try using SQL Refactor's smart rename).

    David
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.