Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Closed Thread
Old 07-31-2009, 02:45 PM ASP and SQL Server
Average Talker

Posts: 25
Trades: 0
I am working with a form and I would like to know why SQL Server 2000 will only accept varchar and up to 8000 characters when I need to have text. When I go to my form to view it and I have in the database text, it will not show text. If I switch back over to varchar it will show the information on the form. I would like to know how can this problem be solved when I need text as I have a large amount of text inside of varchar?

Thanks,
tgmiller5 is offline
View Public Profile
 
 
Register now for full access!
Old 12-22-2009, 04:59 AM Re: ASP and SQL Server
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
why SQL Server 2000 will only accept varchar and up to 8000 characters
from MSDN:
http://msdn.microsoft.com/en-us/library/ms176089.aspx
Quote:
varchar [ ( n | max ) ] Variable-length, non-Unicode character data. n can be a value from 1 through 8,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size is the actual length of data entered + 2 bytes. The data entered can be 0 characters in length. The ISO synonyms for varchar are char varying or character varying.
This means that ms sql server 2000 have a maximum varchar length of 8000 characters.
No way to get higher than that with this datatype.

In sql server 2k5 and up, this limitation is lifted, via the "varchar(max)" syntax.
In sql server 2k, you have to use the "text" datatype, which can hold up to 2 Gb of data.
Both "varchar(max)" and "text" are identical in the result.

http://msdn.microsoft.com/en-us/library/ms187993.aspx
Quote:
text
Variable-length non-Unicode data in the code page of the server and with a maximum length of 2^31-1 (2,147,483,647) characters. When the server code page uses double-byte characters, the storage is still 2,147,483,647 bytes. Depending on the character string, the storage size may be less than 2,147,483,647 bytes.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
View Public Profile Visit tripy's homepage!
 
Closed Thread     « Reply to ASP and SQL Server
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09637 seconds with 12 queries