Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Posts
    19

    Unanswered: Sybase- Query Help

    Hi Guys,

    What is the equivalent query in Sybase for the below query in Oracle:

    SELECT table_name, column_name FROM all_tab_columns order by table_name, column_id

    I am trying to display all the table and column names.

    Thanks in advance

  2. #2
    Join Date
    Jan 2003
    Location
    France - Nancy
    Posts
    26
    select o.name, c.name
    from sysobjects o, syscolumns c
    where o.id = c.id
    order by o.name, c.colid

  3. #3
    Join Date
    Sep 2004
    Location
    Stockholm, Sweden
    Posts
    28
    You can find all the tables in the system table sysobjects. This table contains all objects like tables, trigger, sp etc. User tables are market with U in the type field.

    select name, id from sysobjects where type = 'U'

    You find the columns in syscolumns.

    select name from syscolumns where id = @table_id

    where @table_id is the id from the first query. To get the types of the columns, join syscolumns and systypes, check the Ref Manual for more info.

    /Mats

  4. #4
    Join Date
    Sep 2003
    Posts
    19
    Thank you so much guys...

    That worked like a charm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •