Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Field Problem 1

Status
Not open for further replies.

slr22

MIS
Jun 26, 2002
80
US
I'm trying to create a field where I can hold more than 255 characters. Previously we were using SQL 6.5 and now we have switched to SQL 2000. With the old version of SQL I had created a field text which allowed more than 255 characters, however now when I try to do the same thing in the new version of SQL it only allows me to type in a total of 255 characters. I'm not sure if maybe it is the version difference and they have changed something or if I'm using the wrong field. Can anyone help me out? I need a field where I can enter in more than 255 characters.

Thanks in advance.
 
The Text and varchar datatypes can both hold more than 255 characters.
 
varchar and char fields can hold 8000 charaters, nchar and nvarchar can hold 4000 charaters and text, ntext can pretty much get as large as you need.

If you look in Query Analyzer under options you might find you are set up to display only 255 characters.
 
Thanks for your help. Under the options in the query analyzer it was set to only display 255 characters. Thanks again.
 
How can a record hold more than 8000 character ? HELP

Not true: SQLSister says "...ntext can pretty much get as large.."

He must know something we don't !

HELP


 
CoolCoder, please try not to post the same question multiple times (this is the third time I have read it in the last 5 minutes!).

Text and ntext data types are designed for holding large amounts of character data. From BOL:

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.

ntext:
Variable-length Unicode data with a maximum length of 2^30-1 (1,073,741,823) characters.
--James
 
BY the way from my name you might be able to infer that I am NOT a he.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top