Solved

simplest query

Posted on 2006-10-23
6
10,584 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
ID: 17792094
sp_help tablename

Regards,
Bill
0
 

Accepted Solution

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

Expert Comment

by:PegasusAloft
ID: 17808042
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:PeretzBenRafael
ID: 17851609
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
ID: 17852448
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
ID: 17852898
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

911 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

23 Experts available now in Live!

Get 1:1 Help Now