Etlworks lets you customize the data types used in auto-generated CREATE TABLE and ALTER TABLE statements. Useful when the target database has type-specific requirements or limitations.
Data Type Overrides
The Data Type Overrides feature maps source data types to the data types you actually want in the destination. The mapping is applied whenever a flow generates a CREATE or ALTER TABLE statement against the connection.
How does the override work?
- Exact match. Only exact, unparameterized type names are replaced. A mapping from datetime2 to datetime2(6) replaces datetime2 but not datetime2(3).
- Case-insensitive. Type names match regardless of case.
- Connection-scoped. The mapping applies to all flows that use this connection.
Example mappings
| Source type | Target type |
|---|---|
| datetime2 | datetime2(6) |
| text | nvarchar(max) |
| int | bigint |
How do I configure type overrides?
- Open the target database connection.
- In Data Type Overrides, add key/value pairs where:
- Key is the original data type (as returned by the database driver).
- Value is the replacement data type.
For more control: override the generated SQL
For finer control over the generated SQL, use a small JavaScript snippet in Override Create and Alter Table SQL. The snippet can modify the SQL before it's executed.
if (!isAlter) {
value = sql.replace(/NUMERIC/g, 'NUMERIC(38,2)');
}
In this example, every occurrence of NUMERIC in a CREATE TABLE is replaced with NUMERIC(38,2).
For details and more examples, see Override CREATE and ALTER TABLE SQL.