How can we help you today? How can we help you today?

Need syntax for include with wild card

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
NDUCKSTE
0

Comments

9 comments

  • Chris Auckland
    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 Auckland
    0
  • NDUCKSTE
    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?
    NDUCKSTE
    0
  • NDUCKSTE
    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.
    NDUCKSTE
    0
  • NDUCKSTE
    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
    NDUCKSTE
    0
  • Brian Donahue
    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.
    Brian Donahue
    0
  • Chris Auckland
    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 Auckland
    0
  • Naras
    Thank you very much Chris.
    Why don't update this information on SQLCompare "Switches used in the command line" help.
    Please update the same.
    Naras
    0
  • Naras
    Sorry to post this question here - SQL Compare.

    Thanks
    Naras.
    Naras
    0
  • Chris Auckland
    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 Auckland
    0

Add comment

Please sign in to leave a comment.