Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Question: Length of varchar/text.

Author  Topic 

JornB
Starting Member

4 Posts

Posted - 2004-09-01 : 07:51:51
I have a table that consists of two varchar columns, and I’ve set the length on them to 8000 characters. Yet when I check the maximum length of the data in the column (showed through an asp page) it never exceeds 1024 characters; even when I convert the column to text, it never exceeds 1024 characters.

Now, it’s hard to have a lot of data (in this case asp/html code) when I’m only allowed 1024 characters.

ex.
InnText1 varchar 8000 (shown text never exceeds 1024 characters)
InnText2 varchar 8000 (shown text never exceeds 1024 characters)

With a maximum of 1024 characters I’ll be forced to create 8 columns to be able to have the 8000 characters.

How do I create a column that really support 8000 characters (or rather 20000 characters) and not only 1024 characters? I’ve read that varchar and text both should support 8000 characters but that is something I’ve never experienced myself.

hgorijal
Constraint Violating Yak Guru

277 Posts

Posted - 2004-09-01 : 08:04:36
VARCHAR(8000) really holds 8000 charecters. Check the connection properties from the asp/html page to see if you are limiting it. Or check the properties (length or size) of the field in asp page in which you are displaying the column.

HTH


Hemanth Gorijala
BI Architect / DBA
Go to Top of Page

JornB
Starting Member

4 Posts

Posted - 2004-09-01 : 08:12:26
quote:
Originally posted by hgorijal

VARCHAR(8000) really holds 8000 charecters. Check the connection properties from the asp/html page to see if you are limiting it. Or check the properties (length or size) of the field in asp page in which you are displaying the column.

HTH


Hemanth Gorijala
BI Architect / DBA



Well the thing is I've even tried to fill the row with exactly 8000 characters (directly in the Server Enterprise Manager), and that doesn't work either. The result that I get is a text with not more than 1024 characters.

__________________________
There's no place like 127.0.0.1
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-09-01 : 08:40:27
EM is not meant for inserting data. use Query Analayzer. it works there.

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

JornB
Starting Member

4 Posts

Posted - 2004-09-01 : 15:17:30
I’ve populated my row now, and it works fine until I choose to change the text using an .asp page. I get this error message:

quote:

Microsoft OLE DB Provider for SQL Server error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

/bridge/members/adm/adventures-redsave.asp, line 14



Line 14 says:

obRst(“ADstory”) = Request.Form(“story”)

Now I have no idea what's going on, I'm still within the limit of 8000 characters and as soon as I go down in the length of the column (1024 characters) it works.


__________________________
There's no place like 127.0.0.1
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-09-02 : 06:15:54
this might help you i hope:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;269495

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page
   

- Advertisement -