0

The following error is displayed when attempting to delete a row from within SSMS:

string or binary data would be truncated

image

This is well documented and I understand what might cause this.

In this case I don't get it because I'm not editing the data.

I am loading SSMS, open an existing table, going into Edit top 200 rows, right click on the desired single row and choose delete. At this point the error is displayed that it would be truncated.

In my mind, this means there is already too much data within one of the columns but that shouldn't be possible.

Given there are only 20 columns, I've entered a single 5 character word into every column that has a type of nvarchar(max) or nvarchar(nn) or text and the same issue occurs. The smallest column is nvarchar(50).

It shouldn't matter, but there are no relationships to other data from this specific row.

I am lost - this feels like a bug, but I suspect it's me!!

SSMS2020 connecting to SQL Server Express 2016 (version 13.0.4259, July 2019).

3
  • What happens if you try to delete the row using a SQL query instead of the SSMS GUI? Commented Jun 27, 2024 at 8:20
  • Solved - please move to an answer (although understanding why would be great, the key thing was solving the problem) Commented Jun 27, 2024 at 11:51
  • Can you add the exact SSMS version? Commented Jun 27, 2024 at 22:27

1 Answer 1

3
+50

This is probably a bug in the SSMS GUI.

Confirmed by being able to delete the offending row using a SQL query.

2
  • 1
    FYI, 2019 and later versions can return a more meaningful message. learn.microsoft.com/en-us/archive/blogs/sql_server_team/… stackoverflow.com/questions/6388756/… Commented Jun 27, 2024 at 22:10
  • 1
    Good to know for troubleshooting, if the problem was indeed data truncation. But in this case a row is simply being deleted, thus the error message is obviously misleading. Also, the error only happens if you do it using the SSMS GUI, while a SQL DELETE statement works. Really looks like a bug in SSMS. Commented Jun 27, 2024 at 22:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.