1

I have a stored procedure in SQL Server where I am attempting to write out a JSON file using BCP. The file is being written out; however, there appears to be a 2033 limit on each line. BCP does not handle this well, so the file writes out the first 2033, then a TON of spaces, then continues - truncating exactly at the 2033 limit.

I've tried creating a temp table, and writing from there - no dice. The BCP is not overly complicated, it's creating a JSON with nested entries, but that is working fine. On the BCP call, I am using the following flags: -c -t, -T -S -r

Obviously, I am needed a fully formed JSON - not a truncated one. Any tips on how to fix this? Since it's a stored procedure, tweaking the UI isn't going to help. This stored procedure works fine on small exports; however, the one I'm working on is much larger.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0