Red Gate forums :: View topic - Altering a column with indexes
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

Altering a column with indexes

Search in SQL Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
anna.p



Joined: 03 Jul 2012
Posts: 23

PostPosted: Wed Apr 24, 2013 10:59 pm    Post subject: Altering a column with indexes Reply with quote

Hi there,

I compared two tables that were identical except for a changed datatype on ColumnA and some indexes, one of which accessed ColumnA - we'll call it IDX_ColumnA. My goal was to sync the datatype of ColumnA and nothing else. I turned off the "Indexes" option hoping it wouldn't attempt to sync them.

Here's what I wanted the script to do:
    DROP INDEX IDX_ColumnA
    ALTER COLUMN ColumnA
    CREATE INDEX IDX_ColumnA

Instead, what it included was DROP INDEX statements for all those that existed in the target but not the source, and then the ALTER COLUMN.

Is there any way I can achieve what I want?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Mon Apr 29, 2013 1:45 pm    Post subject: Reply with quote

Hello,
SQL Compare only drops indexes when it absolutely needs to allow SQL Server to accept the changes. Without knowing the schema I can't say why the indexes are being dropped in your case. So there may not be an option that you can set to avoid it.
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