Options

Compare multiple destination, Excluding INDEX creating/delet

coolmind1414coolmind1414 Posts: 6
edited November 5, 2014 5:31PM in SQL Compare 11
everyone,

very new to Compare 11
I am trying to use Command Line SQL Compare,
As of now, I am at the stage where I can include Tables, SP and Exclude Views.
Now, First
I would like to exclude INDEX Creation, and

Second: I would like to run the command for 500 databases on same server

Please let me know if I am not clear at any point.

my sample command


C:Program Files (x86)Red GateSQL Compare 11>sqlcompare /server1:L111111 /Database1:Dev1 /server1:L111111 /Database2:Dev2 /filter:testing1.scpf /scriptFile:"C:ABCfilter.sql"

Where in filter, I have included only Table and Stored Procedure
Now editing filter, I am not sure how to exclude INDEXes and RefreshView SQL

thanks in advance

Comments

  • Options
    Hello,

    You should be able to do this with the following switch:

    /Options:Default,IgnoreIndexes

    Here's a list of options: http://documentation.red-gate.com/displ ... mmand+line

    Regarding running the command for multiple databases, you'll need to use a utility other than our tool to run the command line script 500 times and change the value of /database2 for each one.

    Hope that helps.

    Thanks,
    Evan
    Evan Moss
    Product Support
    (866) 627-8107
  • Options
    Great, Thank You for your quick response. I really appreciate it.
    What about excluding DROP commands in Destination Database, Let's say, there is 1 table I have to create in Destination db, but don't want to Create that in Source, is there any exclude command?

    DROP TABLE
    DROP PROCEDURE

    BTW after your reply, I made good progress on testing this tool. We are trying to figure out if this suits our requirement or not. Again, thanks for your help.
  • Options
    Hello,

    You can use the /exclude:additional switch to make it so objects that only exist in the target aren't dropped.

    Thanks,
    Evan
    Evan Moss
    Product Support
    (866) 627-8107
  • Options
    Thank You for your reply.

    I have used Filters so I can not use exclude at the same time, correct?

    So If I decide to use EXCLUDE, what would be the syntax for excluding Schema?

    What if I have 10 tables to exclude? do I use

    /exclude:table:table1,table2
    or
    /exclude:table:table1 /exclude:table:table2

    Same thing goes for Stored procedure in excluding list.

    Also, where I can read all these information?

    thanks in advance
  • Options
    Hello,

    Unfortunately I can't think of a great way to use the exclude switch and have it scale if you add new objects in the future.

    I just did a bit of testing with the /project switch, and it looks like you can do a compare in the UI, deselect the "objects that only exist in target" in the results pane, then save the project. When you call it using the /project switch from the command line, it will remember to exclude objects only in target regardless of new objects added or removed in the future. This way you can also get the functionality of the filter. (You won't have to use the /filter switch, it will be included in the logic of the /project switch).

    Here's the documentation for the command line: http://documentation.red-gate.com/displ ... mmand+line

    Hope that helps.

    Thanks,
    Evan
    Evan Moss
    Product Support
    (866) 627-8107
  • Options
    So If I decide to use EXCLUDE, what would be the syntax for excluding Schema?
  • Options
    Can you clarify what you mean by excluding schema? /exclude:schema will exclude objects of type schema from the comparison, but it will not exclude all objects in the schema. This article might be useful if you are trying to exclude all objects that match a certain form (like schemaname.x) : http://documentation.red-gate.com/displ ... ated+names

    Thanks,
    Evan
    Evan Moss
    Product Support
    (866) 627-8107
  • Options
    Hello,

    Thanks again for all your help. We are doing some nice progress. And It's working also fine.
    In last week's time, I have done parallel processnig using SSIS packages, so I can run it in parallel.

    Also, where do I see pricing information on this.

    thanks,
    Nishit
  • Options
    Hello,

    Glad it seems to be working well.

    You can contact sales@red-gate.com or go to this page: http://www.red-gate.com/dynamic/purchas ... sqlcompare

    Thanks,
    Evan
    Evan Moss
    Product Support
    (866) 627-8107
Sign In or Register to comment.