I have a MS SQL DB with various tables, and one field in particular is causing me grief.
The Data type is set to varchar(100), however the field is limited to 60 characters.
If I try to put any string with more than 60 characters into the field I get an exception, "String or binary data would be truncated". Although the string is shorter than the explicitly set data type, it still throws an exception.
Is there perhaps a DB setting that does this? What could cause the explicitly set data type to be overwritten?
Edit:
The triggers do not copy the value or insert it into another table and they don't use the data either. - (Incorrect)
Strings that are smaller than 60 chars work fine.
All the columns that have varchar(100) give the same problem, but all the other columns accept correct values. The varchar(10) column works fine.
Any row in this table throws the exception if I try to update the field with a string longer than 60 chars.
I am trying to insert the data directly into the field using SQL Server Management Studio.
There is no padding involved.
Answer:
There was a second table where the column was set to 60. The update trigger called a stored Procedure that inserts the data into the "Denormalised" table.
Thanks for all the help.