What are the challenges you face when working across database platforms? Take the survey
Options

Splitting one large script into several smaller ones

crescentDBcrescentDB Posts: 3
edited January 4, 2017 5:39AM in SQL Data Compare
Hi.

Is it possible for SQL Data Compare to generate several smaller *.sql scripts (that need to be executed in order) instead of just having one large script?

I tried using the "Split transactions / batch operations" option, but that didn't seem to work. I did a google search and it looks like that option might only split up the BEGIN TRANSACTION ... COMMIT TRANSACTION blocks into smaller chunks within the same file, but that didn't seem to work either.

Hopefully someone can shed some light on the situation/issue.

Thanks!

Comments

  • Options
    Hi,

    Thank you for your post.

    In order to create several deployment scripts you should use a WHERE filter during the comparison.

    Please see the following document:
    http://documentation.red-gate.com/displ ... ERE+clause

    I hope this helps,
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • Options
    @Sergio:

    Thanks for the reply. Is there a way to automate the process? Say I have a table with 100,000 rows and I want to spilt it into *.sql scripts with 25,000 each... Do I have to manually go in and add where clauses to get the desired result? It'd be nice to have an automated option.

    And what does the "Split transactions / batch operations" option do? I'm still not able to get that to work (it's still one large script file with a single BEGIN TRANSACTION ... COMMIT TRANSACTION block).

    Thanks.
  • Options
    Hi,

    It should split the transactions, this appears to be caused by a bug in version 12 that we are currently investigating, I will update you once this is fixed.

    In the meantime you can either use version 11 or use the filter.

    I am afraid that you will have to set the filter by table.

    Thank you,
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • Options
    Hi,

    This bug has been fixed in the latest version of SQL Data Compare (version 12.1.1):

    You can download it from here:
    ftp://support.red-gate.com/patches/SQLD ... 1.3793.zip

    Thank you,
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
Sign In or Register to comment.