While the type-based selection excludes an entire class of objects, the name-based method allows you to exclude specific objects by name.
To exclude an object by name, use the <ObjectSelection> element of the xml config file and specify one or multiple <Object> elements with the following attributes:
- Schema. Contains the object schema. If not specified, the command line will locate the object by name. We recommend you always specify the schema.
- Name. Contains the object name
- Type. Contains the object type
- Include="true|false". Indicates whether the object should be included or excluded.
The following xml fragment excludes the table employees and the view v_employees:
<ObjectSelection>
<Object Schema="dbo" Name="employees" Type="Table" Include="false"/>
<Object Schema="dbo" Name="v_employees" Type="View" Include="false"/>
</ObjectSelection>
The following list contains the object type that you can exclude:
- Table
- MemoryTable
- View
- StoredProcedure
- UserDefinedFunction
- UserDefinedDataType
- ClrDataType
- UserDefinedTableType
- XmlSchemaCollection
- Default
- Rule
- Schema
- User
- DatabaseRole
- ApplicationRole
- Certificate
- AsymmetricKey
- SymmetricKey
- PartitionFunction
- PartitionScheme
- FullTextCatalog
- Synonym
- Assembly
- Aggregate
- DatabaseTrigger
- Sequence
- BrokerMessageType
- BrokerContract
- BrokerQueue
- BrokerRoute
- BrokerService
- BrokerRemoteServiceBinding
- BrokerPriority
- FullTextStopList
- SearchPropertyList
- SecurityPolicy
- ColumnMasterKey
- ColumnEncryptionKey
In addition to these types, one macro-type is supported as well:
- None. Excludes all database objects
You can combine the macro-type None with the real types to achieve the desired results. For example, to include a table named employees and exclude all other objects, you could use following xml fragment:
<ObjectSelection>
<Object Name="" Type="None" />
<Object Schema="dbo" Name="employees" Type="Table" Include="true"/>
</ObjectSelection>
Level-two objects, such as columns, constraints, indexes, triggers, statistics, extended properties, permissions can't be excluded directly. These objects are excluded when the parent object is excluded.
Total compare from data to schema with IDERA SQL Comparison Toolset. Learn more > >