Sunday, March 11, 2012

"string or binary data would be truncated" error message

I am getting the message ("string or binary data would be truncated") when trying to update a field in a table in my database, but am unclear as to why. I understand that the error usually occurs when the length of a string exceeds the limit allowed for a field in the database, but in this situation, that constraint should not apply. The length of the field for which I am trying to make the update is a varchar field of length 100. The value for which I am attempting to update is an e-mail address of length 42 of the format xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@.yahoo.com. The initial insertion of the value (via my website) succeeded in inserting the first 40 characters of the address, but cut off the "om" at the end. It doesn't seem to matter how large I make the field in the database as it always gives me this error when I try to make the update. I have tried to change the value in both Query Analyzer and Enterprise Manager, but I invariably receive the same error.

Any ideas?I just posted my best guesses of causes for this here:

http://forums.asp.net/thread/1366165.aspx

Hope it helps,

Joe|||Thanks, your tips actually did help. There was a trigger on the table I was trying to insert into and it was attempting to insert into a table where the email field only allowed for addresses as large as 40 characters.

No comments:

Post a Comment