Red Gate forums :: View topic - Command line options for script folders
Return to www.red-gate.com RSS Feed Available

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

Command line options for script folders

Search in SQL Compare Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
Ransha



Joined: 22 Dec 2011
Posts: 3
Location: Herzelya, Israel

PostPosted: Thu Dec 22, 2011 1:56 pm    Post subject: Command line options for script folders Reply with quote

Hi,

I'm using the SqlCompare command line interface (version 8.5) trying to compare and sync 2 script folders. The batch I execute is as follows:

set scripts1=C:\DB Upgrade\NewDatabaseVersion
set scripts2=C:\DB Upgrade\OldDatabaseVersion
set output=C:\DB Upgrade\SchemaUpdate.sql

SQLCompare.exe /scr1:"%scripts1%" /scr2:"%scripts2%" /sf:"%output%" /f /sync /o:Default,ForceColumnOrder

I've also tried it without the "Default" option.

The resulting script does not contain any column order enforcing code. More specifically, I have a table that I've removed and added columns to and I would like to keep the order of the columns as they appear in the table's creation script.

Any ideas?
_________________
Ran Shani
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 309
Location: Cambridge, UK

PostPosted: Fri Dec 23, 2011 3:32 pm    Post subject: Reply with quote

The "Force Column Order" option is used when "columns are inserted into the middle of a table" and it forces a rebuild of the table. This means that it copies the data into a temp table, drops the table and recreates it with the new column order and then inserts the data back in.

I am not sure what you mean by "column order enforcing code" as sql server itself does not do anything in this regard and so the t-sql is not always indicative of what is happening.

I would recommend that you test the script out on a test database first and observer the changes being made on that table. If you then do not see the changes that you expect, then please let me know.
_________________
Chris Kelly
Technical Support Engineer
Back to top
View user's profile Send private message
Ransha



Joined: 22 Dec 2011
Posts: 3
Location: Herzelya, Israel

PostPosted: Mon Dec 26, 2011 9:20 am    Post subject: Reply with quote

I have tried the script before I posted a question here. The column's order is not saved in the table, i.e. the new columns are added at the end of the table.
To be more specific, the case is as follows: The table has one column which was renamed (which should be interpreted to a remove and add operations while its "index" should be preserved). There's also a new column which was added at the middle and a few that were added at the end. None of these columns appear in the order they should in the modified table (after executing the script on the database).
To conclude: the ForceColumnOrder has no affect on the comparison sync script.
_________________
Ran Shani
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