Sorrido
Programmer
- Oct 17, 2001
- 6
Hey Guys, I'm a developer without a DBA who is having an odd problem with SQL Server 2000, and was hoping someone here could shed some light on what is going on.
I'm trying to insert a fairly lengthy VarChar (around 6500 characters) into a VarChar column in SQL Server 2000 using a stored procedure. Now, the size is set to 8000 for both the column and the variable in the stored proc.
When the insert of the lengthy string happens, I get an implicit conversion error (from nText to VarChar). The insert works just fine when other smaller strings are used, and I've already parsed the string out for odd characters.
I've discovered that if I cut the string to this one point, the insert works, but if I add more text (even just typing plain text into the editor field), the error occurs. It has to be a size issue, but I'm at a loss because the size is way below the published max size for the type.
I found an article on MSDN that listed the error I'm getting ( and says that it's better not to have any varchar field in SQL Server 2000 that's larger than 4000 characters... but, isn't 8000 characters the max? I've found countless websites that list 8000 as the max, and seem to use this without issue.
Can someone shed some light on what size a varchar field should REALLY be for SQL Server 2000 to behave? Is it 8000 or is it 4000, and if it's 4000, why? The published max size for varchar in SQL Server 2000 is 8000, so why is it better to keep it half that? I'm confused.
Of course, I'm often confused.
Thanks to anyone who can answer this!
I'm trying to insert a fairly lengthy VarChar (around 6500 characters) into a VarChar column in SQL Server 2000 using a stored procedure. Now, the size is set to 8000 for both the column and the variable in the stored proc.
When the insert of the lengthy string happens, I get an implicit conversion error (from nText to VarChar). The insert works just fine when other smaller strings are used, and I've already parsed the string out for odd characters.
I've discovered that if I cut the string to this one point, the insert works, but if I add more text (even just typing plain text into the editor field), the error occurs. It has to be a size issue, but I'm at a loss because the size is way below the published max size for the type.
I found an article on MSDN that listed the error I'm getting ( and says that it's better not to have any varchar field in SQL Server 2000 that's larger than 4000 characters... but, isn't 8000 characters the max? I've found countless websites that list 8000 as the max, and seem to use this without issue.
Can someone shed some light on what size a varchar field should REALLY be for SQL Server 2000 to behave? Is it 8000 or is it 4000, and if it's 4000, why? The published max size for varchar in SQL Server 2000 is 8000, so why is it better to keep it half that? I'm confused.
Of course, I'm often confused.
Thanks to anyone who can answer this!