SQL Server with new DB Writer

In old Database Writer I was able to specify the length of output string, say varchar(6000).
In new node there is only type mapping S to varchar and node failed with data truncation message. Is there a way to fix it? Also, to say which field is truncated will be a big plus.

You can use a DB Table Creator node to specify which columns of which type and size will be created with the new table. There is even an option to use dynamic settings if your varchar columns are not limited to a specific length. The DB Writer could be direct connected to the DB Table Creator output port to be executed afterwards.

Maybe you have to execute a drop table using the DB Table Remover before if you want to create a new table on each execution.


I’m happy to here that there is a solution, @MichaelRespondek. Does your answer mean that DB Writer is incompatible and can not create long varchar field not saying of dynamic one? Is it possible to add mapping to make dynamic field work?

The new DB Writer supports writing of ‘long’ varchar fields but it creates all varchar fields with the default length of the database.

On the legacy Database Writer it was possible to change the default length of all varchar fields. All varchar fields got the new default length, even small fields. So that wasn’t effective for many use cases, so the developers canceled this option in the new node ‘DB Writer’.

Please use the DB Table Creator Node instead for the database creation and activate the option ‘Use dynamic settings’. On the tab ‘Dynamic Type Settings’ there are many options for a type mapping, like ‘Name-Based SQL Type Mapping’ and ‘KNIME-Based SQL Type Mapping’ to get a more granular setting for each or all string columns. The results are shown actualized in the Columns tab for fine tuning of the settings.


1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.