SQL Source Control - 2.2
Learning SQL Source Control - 2.2
Using filters to exclude objects
You can create filters to exclude objects from SQL Source Control.
When you exclude an object with a filter, it is not shown on the Commit Changes tab, the Get Latest tab, or the Undo Changes dialog box. This means you can never commit, get, or undo an excluded object.
This is useful, for example, if there is a set of objects that you never want to commit, or consider for source control purposes.
Creating and editing filters
There are two ways to create or edit your filter:
- In the Object Explorer right-click a database, folder, or object, select Other SQL Source Control Tasks, and click Edit Filter Rules...
The Edit Filter Rules dialog box is displayed.
- On the Commit Changes or Get Latest tab, right-click an object in the list of changes, and click Edit Filter Rules...
The Edit Filter Rules dialog box is displayed.
The Edit Filter Rules dialog box lets you specify exclusion or inclusion conditions for individual objects or all object types:

You can exclude object types using the check boxes in the left-hand pane, or build more complex conditions by specifying AND clauses and OR conditions in the right-hand pane.
When you create a filter rule, its conditions are displayed in the left-hand pane, under the name of the object type it applies to:

To clear the filter rule for an object type click the
(Clear) button next to its name.
Sharing filters
You can commit your filter to source control, and get the latest version when it changes.
This is useful for teams that want to exclude a set of objects across an entire development project.
When you create or edit a filter, SQL Source Control shows it on the Commit Changes tab:

You can see the differences between your current filter and the version in source control.
Example: excluding objects with a specific name or owner
If you never want to commit changes to any tables that have names beginning with Marketing, or any owned by the schema Marketing, regardless of their names:
- In the Object Explorer, right-click the database, select Other SQL Source Control Tasks, and click Edit Filter Rules...
The Edit Filter Rules dialog box is displayed.
- In the
box, ensure Exclude if is selected - Under Property, select Object name.
- Under Operator, select Begins with.
- Under Value, type Marketing.
- Click

A new OR condition becomes available.
- Under Property, select Schema name.
- Under Operator, select Equals.
- Under Value, type Marketing.
- Click Save and close.
The filter is applied. All objects owned by the schema Marketing, or with names that begin with Marketing are excluded by SQL Source Control.
You can commit the filter if you want to share it with the rest of the development team.
See also |
Was this article helpful?
SQL Source Control
- Setting SQL Compare options within SQL Source Control
- "ICredentialsProvider is unset, therefore can't get" error occurring within SQL Source Control
- Linking fails due to SVN pre-commit hooks
- Logging changes to shared databases
- Object changed by Unknown
- Setting permissions for SQL Source Control
- Using SQL Source Control with Team Foundation Server 2012 or tfspreview.com
- Error: Failed to resolve no-ops after 5 tries
- Using SQL Compare or SQL Changeset scripts with SQL Source Control
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Source Control
- Database development models
- Release notes - version 1.0
- Release notes - version 1.1
- Release notes - version 2.0
- Release notes - version 2.1
- Release notes - version 2.2
- Requirements & prerequisites
- Technical Overview
- Release notes - version 3.0
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Using SQL Source Control
Working with source control systems