Cdata Sync Alter Schema enabled but allow user to set target data type

Hey All,

I’d like to enable cdata sync’s alter schema feature. However, I want to set any newly discovered columns  in the source table to a string data type in the target table.

I’d also like to Alter schema to not change the data type of the target table, even if the source data type changes. My staging tables all use string data types for every field.

Is this possible? is there an advanced setting that I can enable? 
 
I checked the cdata sync documentation for Alter Schema and didn’t see this mentioned.

​ @MarchPhone35

With AlterSchema property enabled Sync can automatically detect a new column added upstream and add it to the destination table via an ALTER TABLE. It looks like what you are looking for is a way to force the new column type in the source to be a string however, before we can look into suggestions it is important to learn more about the Source and the Destination along with the full use case. Would you be able to provide what is the Source and the Destination?

Regarding the second point, Sync will not attempt to change the datatype. We only alter if the column needs to be widened so if everything is already defined as a string, Sync will not attempt to downcast to an int.

Ethem’s point about widening is useful, but the first requirement is the tricky one: if Sync derives a new target column from the source type, enabling Alter Schema won’t force it to string. If your source supports views, a practical workaround is to sync from a view that CASTs every column to varchar/string; then new columns arrive already as strings and existing target types stay stable. If views aren’t possible, a custom query/transform in Sync may achieve the same—worth confirming with support whether AlterSchema can take a type override.