Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003
    Posts
    38

    Question Unanswered: Query to find a particular column name

    Hi,

    I have sybase ASE 12.0. Under the master database, I have user-defined tables (say 10 of them) created with different column names.

    I need to write a query to be executed via isql that finds if any of the tables have a particular column name. For example, I need to find in which of the 10 tables, the column name is 'val'.

    I know that the list of user defined tables can be queried using:
    SELECT * from sysobjects where type = 'U'

    Thanks!!
    Anu_R

  2. #2
    Join Date
    Jan 2003
    Posts
    26

    Re: Query to find a particular column name

    Try this:
    select a.name
    from sysobjects a, syscolumns b
    where a.id = b.id
    and b.name = 'column name'

    Frank

  3. #3
    Join Date
    Jun 2003
    Posts
    38

    Re: Query to find a particular column name

    Originally posted by frankp
    Try this:
    select a.name
    from sysobjects a, syscolumns b
    where a.id = b.id
    and b.name = 'column name'

    Frank

    Thanks Frank!! this helped.

    Anu_R
    Last edited by Anu_R; 07-15-03 at 06:09.

Posting Permissions

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