Solved

simplest query

Posted on 2006-10-23
6
10,567 Views
Last Modified: 2010-07-16
Hi there,

  just started with sybase. pls tell me how can I get a table's description in sybase?

I know in oracle "describe 'table name'; "   does the job. how about sybase?


0
Comment
Question by:goldenrule
  • 3
  • 2
6 Comments
 
LVL 19

Expert Comment

by:grant300
Comment Utility
sp_help tablename

Regards,
Bill
0
 

Accepted Solution

by:
PegasusAloft earned 50 total points
Comment Utility
Select * from systable (or syscolumn) where table_name = yourtablename
0
 

Expert Comment

by:PegasusAloft
Comment Utility
Give this a shot (if not using Sybase Central and ASE):

select A.Table_name, B.column_name,
       (Select domain_name from SYSDOMAIN where domain_id = B.domain_id) as DataType,
        B.width as DataWidth,
       (CASE Pkey
        when 'Y' then 'YES'
        else NULL
        END) as Pkey
from SYSTABLE A, SYSCOLUMN B
where B.table_id = A.table_id and A.Table_Name NOT LIKE ('SYS%')
order by Table_Name, column_id
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 1

Expert Comment

by:PeretzBenRafael
Comment Utility
PegasusAloft
    Err, what version of Sybase are you referring to?  I'm working with ASE 12.5, and there are no objects named SYSTABLE or SYSCOLUMN in any of my databases.  I just peeked.

    This reminds me: There aughtta be a rule that any post contain the Product (ASE, MYSQL, ...) and Version in which the user is working.
0
 
LVL 19

Expert Comment

by:grant300
Comment Utility
Peretz,

ASE, any version, any database, you will find "sysobjects" and "syscolumns".

sysobjects has the tables, views, stored procs, system tables, etc in it.

syscolumns has the columns for tables, views, etc. in it.

This entire discussion is academic anyway.

Just use
sp_help tablename

Bill
0
 

Expert Comment

by:PegasusAloft
Comment Utility
sp_help apparently is not supported under either ASA 8 or 9 ("error: Transact-SQL feature not supported).

Just my .02 cents
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now