Red Gate forums :: View topic - Sql Compare 10.1 Command Line Migration Script Folder
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

Sql Compare 10.1 Command Line Migration Script Folder

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



Joined: 27 Sep 2010
Posts: 11

PostPosted: Mon Mar 19, 2012 3:37 pm    Post subject: Sql Compare 10.1 Command Line Migration Script Folder Reply with quote

Hello,

please help me to achieve the following scenario:

Given:
.) Only Sql Compare
.) DataBase scripts in SVN (but not with Sql Source Control)
.) Server: SQL Azure
.) Table: Test1
.) other tables have a relation ship to Test1

I want to rename the table Test1 to Test2.

sql compare 10 (command line!) does not recognize, that i want to rename this table, drops Test1 and creates Test2.
it's clear to me that the sql-c doesn't know what i wan to do but how i can tell sql-c that Test1 'is' Test2?

I've seen that the new version 10.1 does support a /migrationfolder command line option.

Now my questions:
.) Does this command line option helps me in this case?
.) how the files have to be named?
.) do i have to write normal sql commands and sql-c interprets/merges my commands or do i have to write environment specific sql (eg. for sql azure!)?
.) do the commands from the files run in the same transaction as the generated script from sql-c?

.) and WHY there is NO DOCUMENTATION about this feature?! (we are a paying customer!)

thanks in advance,
regards,
Bernhard
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1120
Location: Twitter: @dtabase

PostPosted: Mon Mar 19, 2012 3:43 pm    Post subject: Reply with quote

Unless you need to run this as part of an automated build process, for a rename you can simply map the tables in the Table Mapping tab of the Edit Project screen in SQL Compare 10.

Apologies for the documentation issue. Can I ask how and where you looked so we can look into improving this?

Kind regards,

David Atkinson
Red Gate
Back to top
View user's profile Send private message Send e-mail
SeriousM



Joined: 27 Sep 2010
Posts: 11

PostPosted: Mon Mar 19, 2012 4:19 pm    Post subject: Reply with quote

Hi David,

as i have written, i use the (quote:) 'sql compare 10 (comand line!)'.
we use it in an automate build process for continous integration.
can you please read the entire post and help me (please)?

@documentation:
ive looked at the product page, the support pages, the forum and even the wiki but there is no documentation. you can choose where you want to put more into about this feature.

thanks in advance
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1120
Location: Twitter: @dtabase

PostPosted: Mon Mar 19, 2012 4:37 pm    Post subject: Reply with quote

Sorry, I missed the command line reference.

The good news is that the changes you can make in the UI can be stored in a saved project.

So make the changes I suggested earlier in the SQL Compare UI, save the project (.scp file) and reference this from the command line using:

Code:
sqlcompare.exe /project:<yourproject.scp>
Back to top
View user's profile Send private message Send e-mail
SeriousM



Joined: 27 Sep 2010
Posts: 11

PostPosted: Mon Mar 19, 2012 6:30 pm    Post subject: Reply with quote

Hi David,

i was asking for a command line solution for continous integration.
we do not have the licences to give every developer a sql compare version and this does not solve the problem at all!

again: please tell me how i can use the migration script folder.
please read my entire post and then help me (please!).

i do not want to use the UI and i do not want to use the project file saved by the UI.

thanks in advance,
bernhard
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1120
Location: Twitter: @dtabase

PostPosted: Mon Mar 19, 2012 10:07 pm    Post subject: Reply with quote

Why doesn't the solution I gave work for you? You just have to use the UI once to define the mappings required. This produces the project file that can be referenced from the command line.

If you want to benefit from migration scripts, you will require SQL Source Control, which you have said that you don't use. Besides, I'm not sure this is needed in your scenario.

David
Back to top
View user's profile Send private message Send e-mail
SeriousM



Joined: 27 Sep 2010
Posts: 11

PostPosted: Tue Mar 20, 2012 9:33 am    Post subject: Reply with quote

Hi David,

i ask you to understand that we wont use the UI for this task.

"sql compare 10 console" has the /migrationfolder command line option and all i want to know is how i have to use it.

i ask you (again) to help me and answer my questions:

.) how the files in the migration folder have to be named?
.) do i have to write normal sql commands and sql-c interprets/merges my commands or do i have to write environment specific sql (for sql azure!)?
.) do the commands from the files run in the same transaction as the generated script from sql-c?

thanks in advance,
bernhard
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1120
Location: Twitter: @dtabase

PostPosted: Tue Mar 20, 2012 10:26 am    Post subject: Reply with quote

Migration scripts (and hence the /migrationfolder option) require you to use SQL Source Control in conjunction with SQL Compare (command line or UI) so this isn't an option for you. SQL Compare cannot leverage migrations scripts without the migrations repository created by SQL Source Control.

If you want to read more about how this works, please visit the following link:

http://www.red-gate.com/supportcenter/content/SQL_Source_Control/help/3.0/SSC_EG_Deploy_Migrations

I'm still struggling to understand why you can't use sqlcompare.exe /project. This only uses the UI once to create the project that includes the table mappings. After this you can just use the command line and reference the project. Is there any reason why you can't create the project?

David
Back to top
View user's profile Send private message Send e-mail
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