Link to home
Start Free TrialLog in
Avatar of explorer007
explorer007

asked on

What is the Max length of data type in SQL 6.5

Hi

I am running SQL 6.5 server. I created a column in a table and used the 'text' datatype definition.My front end is Visual Basic 6.0. When storing into the database into this field,only a max of 255 characters are stored in the database, which is quite surprising. The rest of the characters are truncated.
I presume, 'text' datatype in SQL 6.5 should be able to store more than that. (16 bytes).Why is this problem occurring. I am not even able to specify the User Defined Data type. When creating a User Defined Data Type, I have to specify the Base Datatype to use and when I specify 'text', I am unable to specify the size and it takes the default to be 16 (bytes if I am correct... How many characters would that make ?).Using varchar and char is not possible since that only takes 255 char.

Please help ...

Thanx

KC
Avatar of ahoor
ahoor
Flag of Netherlands image

I think this is a VB problem...

The 16 bytes is used for a pointer to the datapages of the text. The text itself can be up to 2Gb.

Possibly your front end does not recognise text datatype, but only varchar which has a max of 255 of course. Also using text datatype in stored procedures is not allowed. Maybe there's the problem?
ASKER CERTIFIED SOLUTION
Avatar of david_levine
david_levine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
By the way, are you sure you only have 255 chartacters in the database, or do you only see the first 255 in your output?