Set-up Conversion Rules
In Conversion Options
dialog you can view and modify Data type Mapping (correlation between a pair of data types of different databases) used as Conversion rules.
Working with different databases, Cross-Database Studio allows to Migrate structure and data from one database to other and to Compare and Synchronize data and structure between databases.
Since metadata structures' definitions differ from database to database, Cross-Database Studio provides data type Conversion rules for Migration, Comparison and Synchronization.
- Migration process always uses the Conversion
options definitions.
- Structure Comparison uses the Conversion
options rules if the Use Conversion settings while
comparing option is enabled in the Compare options settings dialog.
- Data Comparison is not affected by the
Conversion Options definitions.
- Synchronization uses the same Conversion
Options used by the comparison that preceded it.
Cross-Database Studio supplies a set of default Conversion
Options
. Existing rules may be modified and new rules may be added.
How to use:
- From main menu, select Tools?Convert
Options
. Conversion options
dialog will open.
There is an option to select pair of database vendors.
- From the Source Database combo box select the database type you are going to use as a source for Migration or Synchronization flow.
- From the Target Database combo box select the database type you are going to Migrate or Synchronize your schema or data into.
Data Types table with source and target data types will be shown.
In the
Source Data type column you can see the full list
of native Data types, available in the database vendor, selected from the
Source Database list.
In the Destination Data
type column you can see the native target database data types, suggested by predefined Cross-Database Studio's definition to be used during Migration and Synchronization.
Additional fields are:
Length, Precision and
Scale .
Available values
of Length, Precision" and
Scale are:
- Don't change the conversion rule for selected data type's pair can't be automatically changed during migration or structure comparison process.
- Check before set the
conversion rule for selected data type can be automatically changed during
migration or structure comparison process. If the Conversion algorithm
detects that the data type can't be converted as defined in the conversion
rule, it can use the Alternate data type (defined in Alternate Data
type field for current conversion rule). For additional info see
Advanced section.
- Set maximal the
conversion algorithm will create Destination data type with maximal
available size/length/precision value, supported by native target database.
In case the conversion with this setting is impossible, conversion algorithm
will use Alternate Data type. For additional info see
Advanced section.
- Set specified numeric
value. There is an option to set numeric value for length/scale/precision.
In case the conversion with this setting is impossible, conversion algorithm
will use Alternate Data type.
Additional options, available in Conversion Options
dialog:
- Edit to modify the
Conversion rule for defined data type pair, in the Conversion
options dialog, find Data Types table,
select the row with the data type and press Edit.
Data type Conversion dialog will open.
- Delete to delete the
Conversion rule for specific data type, in the Conversion
options dialog, Data
Types table, select row with data type and press
Delete .
- Add to add a new rule
for a specific data type conversion, in the Conversion
options dialog press "Add", Data type conversion dialog will open.
- Test to get the suggestion how to create conversion rule for a specific data type with specific size/scale/precision setting:
- Select the row with the Source Data type you want to create conversion rule for
- press Test. Test
Conversion dialog will open.
- Define Source Data type parameters
- Press Do Convert . Suggested
conversion rule will be shown in the Target Column
Properties.
Note:
Migration, Comparison and Synchronization are affected, in addition to Conversion rules, by "SQL Vendor Specifics".
These specifications define NULL, Default values and object names case-sensitivity policy.
For more info see topic SQL Vendor Specifics.
Advanced:
Why sometimes conversion algorithm may conclude that defined rule can't be used?
Example:
Source and Target databases support VARCHAR
data type. Conversion rule suggests this data type as target for Varchar
selected in source. The problem may occur when source database supports Varchar
with maximal size 4000, while target database supports only size 256. If all
Varchar fields in source database are defined with size less or equal to 256, it
will not be problem while conversion. If there are fields with Varchar longer
then 256 in the source database, conversion algorithm will not be able to create
a relevant field in the target database, using Varchar data type. To solve this
problem, conversion algorithm will use "Alternate Data type", defined in
conversion rule. For our example, the Alternate Data type may be Binary.
Note: In our example we used Varchar data type. Same scenario may happen with other data types in different types of databases pairs.
See also: