Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

SQL Server 2000 and textareas
Hi all-
I have an issue where I'm trying to save the value of a textarea from a
web page into an MS SQL 2000 database using Java and the JDBC driver
1.1.  I get the following exception:

com.microsoft.jdbc.base. BaseBatchUpdateExcep
tion: [Microsoft][SQLSer
ver
2000 Driver for JDBC]& #91;SQLServer]Cannot
 create a row of size 8111 which
is greater than the allowable maximum of 8060.

So naturally, I pulled back the max character length of the field from
8,000, but I still have the same problem.  Every HTTP request/response
is encoded using UTF-8, so I tried switching from varchar to nvarchar,
but still no dice.  I have tried nearly every combination of field
character length, column size, column type, etc. that I can think of,
but with no luck.

The only thing that seems to work is if I set the character length
limit (on the textarea w/ JavaScript) way below the max column size,
but even then if the textarea includes a lot of line breaks the problem
still crops up (maybe still an encoding issue?)  Any thoughts?  I'm
stumped...

Thanks in advance to anyone who answers....

Tech stuff:
Servlet container: Tomcat 5.5.20
SQL Server: SQL 2000 sp4 (not exactly sure what Windows OS)
JDBC driver: Microsoft SQL Server 2005 JDBC Driver 1.1
Java: J2SE 5.0_09/J2EE 1.4
Am I forgetting anything?
P.S. - I've already seen http://support.microsoft.com/kb/232580; that
was my first stop and I really don't want to implement option 2 unless
I have to...


Report this thread to moderator Post Follow-up to this message
Old Post
govus
12-13-06 12:12 AM


RE: SQL Server 2000 and textareas
Hi

This is not an issue with the column on it's own, but the total size of all
the columns in the row. The maximum number of bytes per row is 8060, see
http://msdn2.microsoft.com/en-us/library/aa933149(SQL.80).aspx therefore if
you have a single varchar(8000) column, the size of the other columns can
only be 60 bytes in total. To overcome this you may want to split the table
into two, and use a view so that you don't need to change your existing code
.
Look at using an INSTEAD OF trigger if you have problems with DML.

You may want to post the DDL see http://www.aspfaq.com/etiquette.asp?id=5006
A different approach may be to use a TEXT/NTEXT column.


John

"govus" wrote:

> Hi all-
> I have an issue where I'm trying to save the value of a textarea from a
> web page into an MS SQL 2000 database using Java and the JDBC driver
> 1.1.  I get the following exception:
>
> com.microsoft.jdbc.base. BaseBatchUpdateExcep
tion: [Microsoft][SQLS
erver
> 2000 Driver for JDBC]& #91;SQLServer]Cannot
 create a row of size 8111 which
> is greater than the allowable maximum of 8060.
>
> So naturally, I pulled back the max character length of the field from
> 8,000, but I still have the same problem.  Every HTTP request/response
> is encoded using UTF-8, so I tried switching from varchar to nvarchar,
> but still no dice.  I have tried nearly every combination of field
> character length, column size, column type, etc. that I can think of,
> but with no luck.
>
> The only thing that seems to work is if I set the character length
> limit (on the textarea w/ JavaScript) way below the max column size,
> but even then if the textarea includes a lot of line breaks the problem
> still crops up (maybe still an encoding issue?)  Any thoughts?  I'm
> stumped...
>
> Thanks in advance to anyone who answers....
>
> Tech stuff:
> Servlet container: Tomcat 5.5.20
> SQL Server: SQL 2000 sp4 (not exactly sure what Windows OS)
> JDBC driver: Microsoft SQL Server 2005 JDBC Driver 1.1
> Java: J2SE 5.0_09/J2EE 1.4
> Am I forgetting anything?
> P.S. - I've already seen http://support.microsoft.com/kb/232580; that
> was my first stop and I really don't want to implement option 2 unless
> I have to...
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
John Bell
12-13-06 10:18 AM


Re: SQL Server 2000 and textareas
That's what I was looking for, thanks!


Report this thread to moderator Post Follow-up to this message
Old Post
govus
12-14-06 12:12 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 08:34 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006