Order of columns is different between compared tables

Table A has a column called Lastout located in line 46 compared Table A has the same named column on line 43.  they don't match and this throws off the comparison. How do I force the application to compare the two columns and not the column on the same line?
Tagged:

Answers

  • Eddie DEddie D Posts: 1,720 Rose Gold 5
    edited March 25, 2021 9:28AM
    Hi CT_CRAIG,
    thank you for your forum post.

    My answer to you, depends if you have enabled the 'Force Column Order' option in the project.

    With the 'Force Column Order' option disabled and the table is identical except for the column order, SQL Compare lists the table as identical.  However, the SQL Differences view will still highlight the column order difference, as the SQL Differences view is provided by a simple textual comparison.  Therefore the table will not be included in the deployment process.

    With the 'Force Column Order' option enabled and the table is identical except for the column order, SQL Compare lists the table as existing in both but different.  Obviously the SQL Differences view will still highlight the difference.  The table will be included in the deployment process, to change the column order in the target so that it matches the column order in the source.

    The column order change is performed by rebuilding the table, as follows:

    • A temp table, a copy of the existing table is created in target whose column order matches the table in the source.
    • The rows of data in the existing table in the target is copied into the temp table.
    • The existing table with the incorrect table order is dropped.
    • The temp table is renamed to become the table dropped in the previous step, now with the correct column order.
    I hope the above answers your question.

    Many Thanks
    Eddie




    Eddie Davis
    Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
  • ejsejs Posts: 6 New member
    I have a question about the temp table copy process.   If the table is part of a schema binding (e.g. a view with indexed columns), will the view be reinstated as schema bound and indices restored?
Sign In or Register to comment.