Red Gate forums :: View topic - table rename means a drop table and recreate?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Source Control 1
SQL Source Control 1 forum

table rename means a drop table and recreate?

Search in SQL Source Control 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
5QL53rv3r



Joined: 02 Sep 2010
Posts: 2

PostPosted: Thu Sep 02, 2010 3:21 pm    Post subject: table rename means a drop table and recreate? Reply with quote

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
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1114
Location: Twitter: @dtabase

PostPosted: Thu Sep 02, 2010 6:07 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
5QL53rv3r



Joined: 02 Sep 2010
Posts: 2

PostPosted: Mon Sep 06, 2010 9:36 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1114
Location: Twitter: @dtabase

PostPosted: Mon Sep 06, 2010 6:20 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group