Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Write Data in DB tool silently truncating data in SQL Server

narayr
5 - Atom

Hello,

 

Lets say I have some data for a column come in that is: .7483333333333333333333333333333333333333

 

I am using a simple input csv to output Data in DB tool to write this data into a table in SQL Server, where the column is defined as NUMBER(10, 4)

 

The workflow runs fine, and in the table the data is .7483.

 

I do not want this to happen, I want an error to be thrown instead of it getting silently truncated. Any thoughts on how to accomplish this? I do not want to manually check anything as I have over 400 tables that this workflow is running for.

 

I know in SSIS this would throw a "The value could not be converted because of a potential loss of data." error

2 REPLIES 2
nagakavyasri
12 - Quasar

@narayr as the column is defined as  NUMBER(10, 4) it will give 4 digits to the right of decimal in the output.

apathetichell
19 - Altair

@nagakavyasri  - yes - that is what @narayr says is happening. What @narayr wants is an error if there are more than 4 digits... correct @narayr ? If that's the case - I'd recommend a test like converting it to text and extracting the substring after the period (i'd use regex as regex_replace([_CurrentField_],".*\.(.*)$","$1") and then I'd use a length function to see how many digits are there. If it's five or more -I'd filter out/drop that row.

 

But short of a control at the driver or database level to error -> I do not know of a way to automate this. Alteryx will not.

Labels
Top Solution Authors