You are viewing limited content. For full access, please sign in.

Question

Question

Issues with update statement from Workflow

asked on June 21, 2024 Show version history

I have seen other posts about this but none of the suggestions have seemed to work. I have a workflow that I want to update records in a database based on the unique ID that it receives. I keep getting an error: "Conversion failed when converting the varchar value to data type int"

I attached my workflow query and test. Confirmed this works on the table SSMS directly. 

I have also tried setting my @ID parameter to @? as instructed in another answer on here, but it yields the same result.  I have also tried changing the parameter value to int16,32 and 64 with no luck. 

SQLquery.PNG
WF_Query.PNG
WF_Test.PNG
WF_Result.PNG
SQLquery.PNG (14.1 KB)
WF_Query.PNG (13.64 KB)
WF_Result.PNG (4.63 KB)
0 0

Answer

SELECTED ANSWER
replied on June 21, 2024 Show version history

This is dependent on the driver, instead of @? try just ? in the query area as well as remove the single quotes. If you switch the driver to be direct and not be ODBC, it will likely work as well with current syntax.

1 0
replied on June 21, 2024

This worked! But I'm confused as to why. I understand the driver thing but this scenario is working on another Workflow on the same server going to the same DB server (different database though). 

But thank you. This at least gets me a move forward path! 

ExistingQuery.PNG
0 0
replied on June 21, 2024

ODBC driver limitation. See note in step 5 in the documentation.

1 0
replied on June 24, 2024

Thank you, John and Miruna for your responses. I'm adding this final detail in case anyone else is researching this exact issue in the future. 

I made a mistake when I created my data source connection from Workflow. I set it up as Sql (ODBC) vs Sql (Direct). Once I changed that, it worked as expected. 

I think I was under the assumption that this would need to change on the server level. It's actually something I was able to resolve by configuring the data source properly in WF itself. 

Adding screen shots for visibility. 

Thanks again! 

ODBC.PNG
Direct.PNG
ODBC.PNG (3.45 KB)
Direct.PNG (4.82 KB)
1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.