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!

Poss. to have column as varchar(4096)?

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi

Is it possible to define a column as varchar(4096)? I need to store text upto 4096 chars. Whats the best way of doing this?

many thanks
lou

 
Hi Lou,

The max size of varchar depends on your default page size for ASE. By default it is 2048 bytes. So unless your DBA created your database with 4096 bytes or higher, I am afraid you will not go above varchar(2048). Your DBA should confirm this or simply in your ASE errorlog there will be a line saying "The logical pagesize of the server is 2 Kb".

However you can always use a column defined as "text" datatype with can store up to 2^31 -1 (2,147,483,647) bytes or fewer. "text" is equivqalent to "clob" in Oracle etc. So in ASE do

Code:
create table abc (col1 integer not null, col2 text null)
go

no sweat and good luck
 
Thanks, sybaseguru. I will have a look at the database page size.

many thanks
lou



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top