Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Location
    India
    Posts
    109

    Unanswered: Getting column information from table

    Hi,

    Is it possible to retrieve column information alone in the sp_columns command? I saw that it has an additional option "@column_name". But when I include it in my sql, it doesn't work the way I had expected it to..

    I had tried sp_columns @table_name='mytable', @column_name='COLUMN_NAME'

    I expect just the column names alone in the resultset. What am I doing wrong here?

    Thanks and Regards,
    Celia.

  2. #2
    Join Date
    Aug 2003
    Location
    India
    Posts
    109
    No problem. I found another way.

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

    It works now. Though am not sure which is the most used way.

Posting Permissions

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