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

Question

Question

Custom Query String Length

asked on May 3, 2023 Show version history

I'm trying to write a long string to SQL using a custom query, and it's being truncated. The SQL type is nvarchar(max) but I can't find a type on the workflow side that doesn't truncate the string.
 

Workflow also doesn't throw an error or warning when the value exceeds the limit.

Is it possible to use very long strings in Workflow?

0 0

Answer

SELECTED ANSWER
replied on May 3, 2023

<hangs head in shame>

Ok. So I wrote a C# script to insert my very long string to get around any workflow limitations, and ended up with the same result. As this outcome was even more baffling I saved my SQL results as csv, and my full string was there.

Today I learned there's a length limit on the SSMS results grid. The truncation was occurring when I copied and pasted to Notepad++ to inspect the JSON.
 

SSMS Grid View.jpg
2 0
replied on May 3, 2023

I checked with the SQL in the custom query and it's performing correctly.

1 0
replied on May 3, 2023

No shame - we've all been there!

0 0
replied on May 4, 2023

Been there, done that laugh. I found that the easiest way to rule out WF for string truncation is to just email myself the token value. Exchange has fairly large limits on the size of an email body. And if your email message errors out, you know your text wasn't truncated wink. (Not that I would recommend playing with 150MB token values)

0 0

Replies

replied on May 3, 2023

I'm sure someone will ask. Workflow 11.

0 0
replied on May 3, 2023

Are you willing to share your Custom Query?

The Custom Query activity has something like a 7,000 character limit for the query, so depending on how you have structured things, that could be part of the issue.

0 0
replied on May 3, 2023

How are you determining the value was truncated? Token values displayed in the instance details on the Tokens tab are truncated to 3700 characters for display only. The runtime uses the full value when replacing the token.

0 0
replied on May 3, 2023

I was reading the JSON string manually, there isn't a workflow issue.

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

Sign in to reply to this post.