sqlmetadatasybasesap-aseisql

From a Sybase Database, how I can get table description ( field names and types)?


I have access to command line isql and I like to get Meta-Data of all the tables of a given database, possibly in a formatted file. How I can achieve that?

Thanks.


Solution

  • Check sysobjects and syscolumns tables.

    Here is a diagram of Sybase system tables.

    List of all user tables:

    SELECT * FROM sysobjects WHERE type = 'U'
    

    You can change 'U' to other objects:

    List of columns in a table:

    SELECT sc.* 
    FROM syscolumns sc
    INNER JOIN sysobjects so ON sc.id = so.id
    WHERE so.name = 'my_table_name'