Need syntax for include with wild card

NDUCKSTENDUCKSTE Posts: 22
edited September 15, 2009 12:27PM in SQL Compare Previous Versions
I'm trying to figure out the SQLCompare syntax for including all the objects that begin with a certain prefix (i.e. Log*).

I've tried the following to no avail:

/Include:table:Log
/Include:table:Log*
/Include:table:^Log
/Include:table:^Log*
/Include:table:^\[Log*
...

Thanks in advance.

Nick

Comments

  • Thanks for your post.

    You don't need to do anything special to include all tables containing Log.

    The first example (/Include:table:Log) should include tables:

    Log
    LogA
    LogB
    New_Log

    If you only want a specific table, i.e. 'LogTest' you will need to use:

    /Include:table:\[LogTest\]

    If are looking to only include tables with a certain schema/owner, i.e.

    Log.Table_A
    Log.Table_B

    Then you will need to add a filter for the 'Log' schema/owner to the project. You can create a filter through the UI, and then reference it through the command line using /filter:

    I hope this is helpful.
    Chris
  • That all makes sense. Thanks.

    I need one more clarification.

    /Include:table:Log) brings back the following tables:

    Log
    LogA
    LogB
    New_Log

    What if I just wanted those that begin with Log*, i.e. omitting New_Log?
  • One more question. You reference the /filter: switch. I see it referenced on the command line when I type sqlcompare /? but I don't see any examples about how to use it on the online docs.

    Do you have any documentation on how to use the /filter: switch?

    Thanks,

    Nick
    Thanks for your post.

    You don't need to do anything special to include all tables containing Log.

    The first example (/Include:table:Log) should include tables:

    Log
    LogA
    LogB
    New_Log

    If you only want a specific table, i.e. 'LogTest' you will need to use:

    /Include:table:\[LogTest\]

    If are looking to only include tables with a certain schema/owner, i.e.

    Log.Table_A
    Log.Table_B

    Then you will need to add a filter for the 'Log' schema/owner to the project. You can create a filter through the UI, and then reference it through the command line using /filter:

    I hope this is helpful.
  • Figured out the filter switch like you suggested, i.e. create a filter file via the UI and then reference it with the /filter: switch.

    However, that hardcodes and XML filter file with specific search criteria. I want my criteria parameterized, not hardcoded. In other words, I can't create a filter file for a every different flavor of a parameter I might encounter -- I simply don't know what all the parameters are in advance.

    Part of my confusion is why I would need the /filter: statement at all. The documentation on include/exclude states that the parameters for these switches are regular expressions:

    /include:<object type>:<regular expression>

    Thanks in advance,

    Nick
    NDUCKSTE wrote:
    One more question. You reference the /filter: switch. I see it referenced on the command line when I type sqlcompare /? but I don't see any examples about how to use it on the online docs.

    Do you have any documentation on how to use the /filter: switch?

    Thanks,

    Nick
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Nick,

    To include objects that begin with a specified string, include the SQL identifier, for instance \[log will match Log, Logfile, Log_Name, but not MyLog or MyLogFileName.
  • There is some information on using filters in the UI helpfile.

    All you really need to do for the CL, is to build a custom filter through the UI, save it, and then reference it using /filter e.g.

    /filter:"D:\SQL Compare filter\myFilter.scpf"
    Chris
  • NarasNaras Posts: 7 Bronze 2
    Thank you very much Chris.
    Why don't update this information on SQLCompare "Switches used in the command line" help.
    Please update the same.
    Thanks
    Naras.
  • NarasNaras Posts: 7 Bronze 2
    Sorry to post this question here - SQL Compare.

    Thanks
    Naras.
    Thanks
    Naras.
  • Why don't update this information on SQLCompare "Switches used in the command line" help.
    Please update the same.

    This will be updated shortly; we forgot to update the documentation with the new feature when SQL Compare 8.1 was released.
    Chris
Sign In or Register to comment.