Options

Different column order while comparing databases

SanderFSanderF Posts: 3
edited September 20, 2007 6:38PM in SQL Compare Previous Versions
Hi,

When I compare two databases, SQL Compare reports also a difference when a column in a table from database x has another index than the column in the table in database y.
Example:
CREATE TABLE Table1 (
Column1 int NULL,
Column2 int NULL,
Column1b int NULL)
and
CREATE TABLE Table1 (
Column1 int NULL,
Column1b int NULL,
Column2 int NULL)

Is it possible to add a 'Ignore option' for this in the options of the Project Configuration?
We had this problem very often because when we update customer-databases via SQL-scripts the new columns will be added at the end.
When we create a new database for a new customer we've put the new fields in a logical order in the CREATE TABLE defintion, so they will differ.
When this option is on, maybe it is possible to sort the columns by name before comparing...

Kind regards,
Sander

Comments

  • Options
    Hi there,

    there is already an option to control this called 'Force column order'. By default it is not checked. When it is not checked your 2 example tables will be treated as identical by SQL Compare. However, the side by side SQL view will still show differences (it simply performs a textual diff).

    When it is checked, SQL Compare will treat your 2 tables as different and will force the column order to be identical if you perform a sync.

    Do let me know if this does not answer your question,

    Tom Harris

    Red Gate Software
  • Options
    Thanks for your answer.

    The problem is that I don't wan't to recreate the tables, because i compare production databases and i just wan't a (quick) report about the differences, while ignoring the column order.

    Is it not possible to sort the columns by name before comparing the data?
  • Options
    Hi there,

    Sorry, no this isn't possible in the current UI. Whilst we could reorder the columns in the SQL Differences pane, it wouldn't be a true representation of what the databases looked like so we have always shied away from doing it.

    We are seriously thinking of ways that we can improve the difference matching and hope to get this into a future version of the product.

    Regards,

    Jonathan
    Jonathan Watts

    -Project Manager
    -Red Gate Software Ltd
  • Options
    I have this exact same issue and use the tool in a similar fashion as posted. Please reconsider, ignore column order on the comparison option.
    :)
Sign In or Register to comment.