Options

SQL Compare / SQL Source Control filter precedence

I'm using SQL Source Control and the SQL Change Automation PowerShell cmdlets to set up build pipelines for many databases. For 99% of the DBs, it works great. However, with one specific DB I have a unique requirement and I can't find authoritative documentation about how to resolve it.

One of the databases includes thousands of tables called "tmp_<GUID>". I want to filter these out. That's easy enough with a filter to exclude any tables prefixed with "tmp_".

However, in amongst those tables are about a dozen tables called "tmp_something_specific". I think these tables are probably important so I'd like to include them. (For the record, I am not responsible for dev/architecture etc and would ideally like to avoid opening that pandoras box for the time being.)

What I want is a filter that does something like:

EXCLUDE objects that start with "tmp_"
EXCEPT:
INCLUDE object that equal "tmp_specific1", "tmp_specific2" or "tmp_specific3"

These filters contradict each other, so I want to understand how SQL Compare will decide which rule takes precedence.

Is there any documentation about filter precedence? I can't find any. If not, could someone please explain how SQL Compare will decide which filter rule will win?

Thanks in advance!
Alex Yates
DevOps Mentor and Coach

Director of DLM Consultants
Creator of Speaking Mentors
Microsoft Data Platform MVP
Friend of Redgate
Twitter / LinkedIn

Answers

  • Options
    Sergio RSergio R Posts: 610 Rose Gold 5
    Hi Alex,

    We currently don't have any documentation for this, I am going to check and will get back to you.

    Kind Regards,
    Sergio
    Product Support Engineer
    Redgate Software Ltd
    Please see our Help Center for detailed guides on how to use our tools
  • Options
    Sergio RSergio R Posts: 610 Rose Gold 5
    Hi Alex,

    For the example that you provide above, here's a filter that will work:

    Include if
    Object Name does not begin with tmp_
    OR
    Object Name Equals tmp_specific1
    OR
    Object Name Equals tmp_specific2
    OR
    Object Name Equals tmp_specific3

    Kind Regards,


    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.