Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: How to read the column name?

    Hello, everyone:

    How to get the column name from a table? Thanks.

    ZYT

  2. #2
    Join Date
    Nov 2002
    Posts
    207
    Two ways to get column names:

    select sc.name from syscolumns sc where sc.id = object_id('<tablename>')

    OR

    select * from <tablename> where 1=2

    HTH.

  3. #3
    Join Date
    Feb 2004
    Posts
    492
    or:

    select column_name
    from information_schema.columns
    where table_name = ...

Posting Permissions

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