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

Experts Exchange Solution brought to you by

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?
Pawan KumarDatabase ExpertCommented:
Changes will be permanent.
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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.
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 ..
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.
Pawan KumarDatabase ExpertCommented:
Question abandoned.
Provided solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Sybase Database

From novice to tech pro — start learning today.