Varchar error in DB Loader

I am trying to write a workflow to copy tables from one Azure SQL DB to another.

After loading the data from the source DB to a DB Reader…I am pushing the data to a target DB Table creator and then a DB Loader. (In other words: Source DB Reader => Target DB Table Creator => Target DB Loader)

In the Target DB Creator I am creating a table based on the source using dynamic settings. This node completes successfully.

When the DB Loader executes, I get an error that the varchar(319) cannot fit into a varchar(255) but I am not told which column is the offender.

I tried going back to the DB Loader, unchecked dynamic settings, and tried to manually define a varchar 1000 to see if I could push things through, but it reset the varchar(1000) to varchar (255).

My Questions:

  1. If both the source and target DB’s are SQL Server, why doesn’t “dynamic settings” work? Is this a bug?
  2. What other variable types or workflow steps should I try?

Hello @RVC2023,

  1. The dynamic settings should ideally work, but they do not cover all edge cases.

  2. On this question, the two options I would try first are:

  • Try using a loop and checking which column will give you an error. You can run a loop and have it check each column until you run into the problem child. You can use the 'column list loop start to do this
    image

  • The other option is to just manually create your table using the ‘DB SQL Executor’ Node and just have the SQL command to create a table to your required specifications. This should fix that problem of having them be reset.

Hope this helps,
TL

1 Like

Can you clarify how I implement the loop?

My intuition was to insert the Column List Loop Start between the target DB Table Creator and DB Loader. But there is no data port output from the DB Loader to communicate with the Loop End.

For the SQL Executor node, I don’t see a table-in port option, so while I can write SQL to build the table manually, I don’t have a way to populate it with data.

Also…is Varchar(255) the highest? Can I set a Varchar(1000) as a default for the DB Table Creator?

Or is there a way to automate a trim in the data table prior to hitting the DB Table creator? Not ideal.

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