how to set column width in Sybase

Hello Experts

How to set the column width in sybase databse.I am looking for alternative of oracle alternative "column <column name> format a<width>" in Sybase.

Vinit kumar
vinit kumarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
Pawan KumarDatabase ExpertCommented:
Looks like do you want to change the width of the column. For that you need to use the Alter command like below.

ALTER TABLE yourtableName
MODIFY ColumName VARCHAR(20)
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
vinit kumarAuthor Commented:
Thanks Pawan for reply
Changes using above command is temporary or permanent.?
I mean changes in width value will be lost as soon as I logout from sybase?
0
 
Pawan KumarDatabase ExpertCommented:
Changes will be permanent.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
vinit kumarAuthor Commented:
Pawan,what will be the command for session specific setting as I don't want to change data default settings.
I need environment setting for so that output is displayed in good format.
0
 
Shery VijayanSenior Database administration support analystCommented:
you can use left or right function or both  and specify the number of characters returned in the query  ..
or  try  using the sp_autoformat stored procedure provided by sybase .

sp_autoformat will dynamically resize columns  wrt to the largets value   ..
performance may be a concern if processing large result sets ..
0
 
Pawan KumarDatabase ExpertCommented:
>> What will be the command for session specific setting as I don't want to change data default settings.
This is not session specific.  You can do changes for session in the SQL query. and that will not change the column size.
0
 
Pawan KumarDatabase ExpertCommented:
Question abandoned.
Provided solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.