Schema filters allow you to include or exclude database objects based on matching criteria. You can exclude, for example, tables the name of which start with "tmp_" or include views that belong to the schema HumanResources.

Schema filters are depreciated and will be removed in a future version of the command line utility. Use entity filters instead.

A schema filter affects only the objects that belong to the class of objects for which the filter is defined. A table filter, for example, affects tables only. When a schema filter is defined, the command line performs one of the following actions:

The command line provides two elements for defining schema filters:

Simple filters are defined as <SchemaFilter> under <SchemaFilters> elements with the following attributes:

The following xml fragment adds a filter that excludes all tables whose name ends with "_tmp":

<SchemaFilters>
     <SchemaFilter Criteria="_tmp" FilterType="EndsWith" ObjectType="Table" Action="Exclude"/>
</SchemaFilters>

Schema filters defined under <SchemaFilters> element are sufficient in most comparison scenarios. It you need more control over the filter criteria, you can define the filters as <SchemaFilterExpression> under the <SchemaFilterExpressios> element. The <SchemaFilterExpression> element contains two attributes:

Under the <SchemaFilterExpression> element, you can defined one or multiple filter criteria. Each criteria is a <SchemaFilterCriteria> element with the following attributes:

The following xml fragment defines two filters: one for views and one for stored procedures. The view filter has three criteria. It selects only views that start with v1_, v2_ or v3_. The procedure filter has two criteria. It excludes procedures the name of which contain _p1_ AND _p2_. The first criteria of the procedure filter is case-sensitive:

<SchemaFilterExpressions>
     <SchemaFilterExpression ObjectType="View">
          <SchemaFilterCriteria Action="Include" FilterType="StartsWith" Criteria="v1_" />
          <SchemaFilterCriteria Action="Include" FilterType="StartsWith" Criteria="v2_" />
          <SchemaFilterCriteria Action="Include" FilterType="StartsWith" Criteria="v3_" />
     <SchemaFilterExpression>
          <SchemaFilterExpression ObjectType="StoredProcedure" FilterValidationType="AllCriteria">
          <SchemaFilterCriteria Action="Exclude" FilterType="Contains" Criteria="_p1_" IgnoreCase="false" />
          <SchemaFilterCriteria Action="Exclude" FilterType="Contains" Criteria="_p2_" />
     </SchemaFilterExpression>
</SchemaFilterExpressions>

 

Total compare from data to schema with IDERA SQL Comparison Toolset. Learn more > >

IDERA WebsiteProductsPurchaseSupportCommunityAbout UsResources Legal