It is definitely possible to save 4000 character comments to a
varchar(4000)
field. One possibility is that you have miscounted your characters. For instance, I believe line breaks count as a character, as do spaces and tabs.
To verify that this isn't a SQL issue, try doing an
INSERT
statement using the Query Editor. Use the
REPLCIATE
command to generate the requisite number of characters like so:
INSERT INTO yourTable (yourColumn) VALUES (REPLICATE('x', 4000));
If that query works (once you modify it to be accurate for your environment) then you know the issue is with the data you are sending in or with your application.
The only other issue I can think of is something to do with your SQL setup. Maybe you upgraded from SQL 2000 and you are still operating in SQL 2000 compatibility mode. If so, then the row size limit is 8060 bytes. Since
varchar
only takes up one byte per character (unlike
nvarchar
, which uses two), you would have to have a lot of data in the row besides the comments. However, it could be possible. If you are operating in SQL 2005 mode, then you won't have that issue since variable data can be up to 8MB I believe.