Exclude using wildcards?

mzcopeamzcopea Posts: 31
edited October 7, 2008 4:02PM in SQL Compare Previous Versions
Can I use wildcards with /exclude? If so, how? For example, I need to exclude all tables that start with EMT.
Thanks!

Comments

  • /exclude takes a regular expression, so you can use .* as a wildcard matching any number of any character.

    The exclude you're looking for is something like /exclude:Table:EMT.*
    Software Developer
    Redgate Software
  • mzcopea,

    Can I ask how you would ideally like to specify a filter? We're reviewing this area for the next release and would ideally like to make it as usable as possible.

    Thanks,

    David
    David Atkinson
    Product Manager
    Redgate Software
  • Michelle: Your suggestion to use EMT.* results in anything with EMT in the name being excluded. I need for the objects that begin with EMT to be excluded. Do you have any other ideas?

    David: You asked how we would like to specify the exclude filter for consideration in future releases. Ideally, what I would have liked to do is this:
    /exclude:ALL:EMT.* in order to exclude all objects that start with EMT.
  • mzcopea,

    "/exclude:ALL:EMT.*" should indeed work! You should be able to filter by 'All' as well as per object type. Please let us know if this doesn't work. To see all the full set of command line options, do the following:

    sqlcompare.exe /help /verbose /html >help.html

    and open up help.html in your browser.

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • David --
    Using "/exclude:ALL:EMT.*" works too good -- it removes all objects that have EMT anywhere in the name. I need to exclude only object that begin with EMT. Do you have any other ideas?

    Thanks.
    Abbe
  • Yes, you can do this if you include the square brackets (which you need to escape with \ as it's a command line argument).

    Try something like this:

    exclude:ALL:.*\].\[EMT.*

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
  • David -

    That works! I never would have figured that one out. Thanks a bunch.

    Abbe
  • No problem at all. If you want to do anything complex or tricky, there are many websites that offer help on regular expressions. Here's just one of them which I got by typing "how to write a regular expression" into Google: http://geekswithblogs.net/brcraju/articles/235.aspx

    Kind regards,

    David Atkinson
    Red Gate Software
    David Atkinson
    Product Manager
    Redgate Software
Sign In or Register to comment.