Manually Editing Target Column Names in an SQL Script
Manually Editing Target Column Names in an SQL Script
If you have source columns with long column names that exceed the length limit that the target database allows, you can edit the column names in an SQL script that you use to generate the target tables. After you run this script, you can generate the audit log tables based on the target table schema if you require these tables for Merge Apply processing or for InitialSync with the Bulk Copy Program (BCP) processing of SQL expressions in SQL Apply mode for Microsoft SQL Server targets.
Because the source and target column names do not match, the Data Replication Console cannot map columns based on column names. You must manually define column mappings for the generated tables.
For example, in the SQL script, replace the TOTAL_NUMBER_OF_MEDICAL_CLAMPS target table name with TTL_NUM_OF_MED_CLAMPS. Then generate an audit log table based on the target table schema and use the default suffixes _OLD and _NEW for the before-image and after-image columns. The Data Replication Console creates the TTL_NUM_OF_MED_CLAMPS_OLD and TTL_NUM_OF_MED_CLAMPS_NEW columns. Map the TOTAL_NUMBER_OF_MEDICAL_CLAMPS source column to the TTL_NUM_OF_MED_CLAMPS target column.
Create a script for generating regular target tables and save it on the local file system.
Open the generated script in a text editor and replace the long column names with shorter names.
Ensure that you can append the before image and after image suffixes that are specified on the
Runtime Settings
>
Calculated Columns
view to new names without exceeding the name length limit of the target database.
Save the edited script.
Run the script to generate target tables.
Generate the audit log tables based on the target table schema.
On the
Map Tables
tab, manually map the source columns to the corresponding target columns.