I've been searching for an answer to this, but no one seems to be asking exactly this question. I created a Notebook in ADS to run a lengthy series of scripts to populate and then export from a temp table. I received an error String or binary data would be truncated. One really nice thing about ADS is that it tells you what data would be truncated! Anyway, the string was 101 characters long, while the column was defined as varchar(100). So, I increased the column to varchar(255) in SSMS. But ADS continues to give me the same error. I tried changing the connection to another DB, then changing it back - no joy. I tried disconnecting and reconnecting the DB - still no joy. Finally, I had to close and reopen ADS before it would recognize the column change. Any ideas why this might be happening, and how to correct it? Because it's not terribly useful this way.

  • 3
    "String or binary data would be truncated" is a SQL Server error not an error from the client and telling you "what data would be truncated" is a recent-ish improvement to SQL Server. I doubt that ADS is inspecting your queries and doing anything with them Commented Aug 17, 2023 at 21:21
  • 1
    @MartinSmith thanks, I pasted the query into SSMS and got the same result. Apparently, the "what data would be truncated" was not as useful as I thought it would be. The string it was giving me back was 101 characters long. But the actual problem record (after changing the column size) turned out to be 277 characters long.
    – CB_Ron
    Commented Aug 18, 2023 at 15:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.