Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 31st, 2004, 05:37 AM
Authorized User
 
Join Date: Apr 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error entering lengthy text into SQL Server

I'm trying to cut and paste about 2000 characters of html into a Sql Server table. When I do so, only the first 300 or so characters get pasted and a dialog box pops up with the following message:

The value you entered is not consistent with the data type or length of the column, or over grid buffer limit.

The datatype for the field I'm pasting the html into is varchar and the length is set to 8000.

ALSO, when I insert a lot of text (approximately 2000 characters) into the database the "normal" way (via the website using a textbox, button, ado.net objects, and stored procedures) the following exception is returned:

Error: Cannot create a row of size 8597 which is greater than the allowable maximum of 8060. The statement has been terminated.

Are these errors related?

I'm using MSDE (stripped down version of SQL Server that comes with VS.NET). Does MSDE limit the amount of data you can put in each cell?

Does setting the length of a field to 8000 mean 8000 characters can be placed in that field or something else?

Is varchar the right datatype to be using for lengthy data?

Answers to any of the above would be most appreciated.

Thanks!

Daniel
 
Old June 1st, 2004, 04:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

The row size has some limitations there. Add up the size of all the other fields in your table and see that doesnot exceed 8060 as the error shows. As you say this particular field is given as varchar(8000) then the remianing fields of a row should count for the remaining 60 bytes. Better you can reduce the size of this varchar(8000) to varchar(4000) or a lesser size that could suit your requirement and not be given more than what you could actually paste to the maximum. Or you can try with TEXT datatype. I am not sure about its size, but that might help you resolve this. See to that the total size of the row does not exceed 8060.

It all depends on how optimised you manage the fieldsize.

Hope that helps.

_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
SQL Server Reg. SQL Server does not exist error Arsi SQL Server 2000 1 June 11th, 2008 11:20 AM
Entering data into an SQL database jmsherry SQL Server 2000 3 July 24th, 2007 01:00 AM
Save a text file on SQL Server petercyriljones SQL Server DTS 2 January 3rd, 2007 07:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.