Red Gate forums :: View topic - Why recreate instead of rename?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Compare 10
SQL Compare 10 forum

Why recreate instead of rename?

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Fenske



Joined: 22 Dec 2011
Posts: 2

PostPosted: Thu Dec 22, 2011 10:42 am    Post subject: Why recreate instead of rename? Reply with quote

Dear Support,

i have a question regarding the generated syncronizing script.

I have an example:
Code:

left side: CREATE NONCLUSTERED INDEX [Name_Vorname] ON [dbo].[Inter] ([Name], [Vorname])

right side: CREATE NONCLUSTERED INDEX [Name] ON [dbo].[Inter] ([Name], [Vorname])


The resulting synchronisation script does the following:
Code:

DROP INDEX [Name] ON [dbo].[Inter]
CREATE NONCLUSTERED INDEX [Name_Vorname] ON [dbo].[Inter] ([Name], [Vorname])


My question is: Wouldn't it be wiser (and a lot faster) if the alteration script only renames the index as all other parameters are equal?

It's kind of a showstopper to us as we need to synchronise very large tables and recreating doesn't qualify for the perfect solution.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1116
Location: My desk.

PostPosted: Tue Dec 27, 2011 12:42 pm    Post subject: Reply with quote

Thanks for your post. This same question was actually asked back in 2005 (ref. SC-1308) and the request was closed, with a comment of:

Quote:

No plans to do this

While indeed it would be more efficient from SQL Server's point of view, because of sp_rename it would confuse system tables, and it would NOT be more efficient in SQL Compare (indeed it would be much more inefficient)


I'm not sure of any more detailed reason as to why it would be more inefficient in SQL Compare unfortunately as that's all that was written on the request, but it sounds like performing the rename could actually make the problem worse and we have no plans to fix it.
Back to top
View user's profile Send private message
Fenske



Joined: 22 Dec 2011
Posts: 2

PostPosted: Tue Dec 27, 2011 5:06 pm    Post subject: Reply with quote

Thank you for your reply.

With kind regards,
Fenske
Back to top
View user's profile Send private message
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