subject: Filter data while migrating between databases [print this page] Filter data while migrating between databases
Data migration is becoming a more frequent job of a database administrator. And many DBAs face the problem how to migratea part of database table to another format. Intelligent Converters released new version of data conversion tools offering smart and flexible solution for such tasks. Now our products allow to filter data during the conversion process via SQL SELECT-queries. Using this feature you can choose particular columns, select data subset or just rename columns in the destination table. Below there are some examples of using queries for different purposes. All these queries use MySQL syntax, but it could be easily translate to any other dialect of SQL. Assume that we have MySQL table "Table1" defined as below:
Table1(
ID INT NOT NULL AUTO_INCREMENT,
FName VARCHAR(50),
LName VARCHAR(50),
Birthday DATE,
Notes TEXT
);
Example 1. This query demonstrates how to select and rename certain columns:
SELECT FName as FirstName, LName as LastName FROM Table1
Example 2. The following query extarcts data subset from the table:
SELECT * FROM Table1 WHERE ID > 1000
Example 3. This query skips records containing NULL values:
SELECT * FROM Table1 WHERE Notes IS NOT NULL
As you can see, SELECT-query filter is a powerful feature that allows you to precisely control the data for converting. With this feature it is so easy to arrange incremental conversion and migrate exact data you wish. It would be definitely useful for daily backup tasks and similar procedures requiring partial data migration. Please visit our official site for the further information about products and technologies: