Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

simplest query

Posted on 2006-10-23
6
Medium Priority
?
10,680 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 200 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
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

885 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