The command line allows you to customize the way the filegroups are mapped and compared. By default, filegroups are mapped by name, but you can choose to ignore them or map them differently.
Consider, for example, a table named employees that in the source database is stored on the filegroup LEFT_FG and in the target database on the filegroup RIGHT_FG. When the table is compared, the difference in the filegroup will trigger a table rebuild. If you change the filegroup settings and map LEFT_FG to RIGHT_FG, the filegroup difference will not trigger any action on the table.
You can change the comparison settings for regular filegroups via the elements <FileGroupSettings>. Filestream filegroup settings can be set under the <FileStreamFileGroupSettings> element. To alter the settings, specify the following elements:
- ComparisonType="Ignore|ByName|ByMappings" Indicates the type of comparison that should be applied to filegroups.
- Mappings Contains the filegroup mappings when the ComparisonType is set to "ByMappings". Mappings are set as <LEFT_FG>:<RIGHT_FG>. When more than one mapping is required, separate them with a semicolon <;>
The following xml fragment sets the filegroup comparison option to a compare by mappings:
Filegroup settings affect the existing database filegroups and the filegroup clause of tables and indexes. Missing database filegroups are NOT created by default.
To create missing database filegroups, include the database objects DatabaseFileGroup and DatabaseDataFile as in the following xml fragment:
<ObjectType Type="DatabaseFileGroup" Include="true" />
<ObjectType Type="DatabaseDataFile" Include="true" />
We strongly recommend that you create the missing filegroups manually.
Total compare from data to schema with IDERA SQL Comparison Toolset. Learn more > >