Results 1 to 13 of 13
  1. #1
    Join Date
    Feb 2004
    Posts
    26

    Red face Unanswered: i need Column names !!

    Hi, i need a query to have the columns names !!
    If you have another solution, let me know !!

    superj !!!

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54

    Re: i need Column names !!

    Originally posted by superj
    Hi, i need a query to have the columns names !!
    If you have another solution, let me know !!

    superj !!!
    I kind of like Bob, Carol, Ted, and Alice myself. What column names do you like?

    -PatP

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    I like them blue. Databases I like yellow.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Originally posted by rdjabarov
    I like them blue. Databases I like yellow.
    So, if you put those columns into a database, does the whole thing turn green?

    -PatP

  5. #5
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Hey, that would be cool!

  6. #6
    Join Date
    Feb 2004
    Posts
    26

    Re: i need Column names !!

    SELECT COLUMN_NAME
    > FROM INFORMATION_SCHEMA.COLUMNS
    > WHERE TABLE_NAME = 'authors'
    > ORDER BY ORDINAL_POSITION

  7. #7
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    select colid, name from syscolumns where object_name(id) = 'authors' order by 1

  8. #8
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Originally posted by rdjabarov
    I like them blue. Databases I like yellow.


    Don't you read Dilbert?

    Muave is the fastest db color
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  9. #9
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    whatever you do, dont get red
    cops look for that color.

    i myself , am currently configuring a Puce database with various pastel colored tables and some chince doilys.

    yes i work for martha stewart living

  10. #10
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Why not :
    EXEC sp_columns @table_name = 'customers'
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  11. #11
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    okay i'll bite


    exec SP_Help tablename

    will give you everything about the table including all column names.

  12. #12
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    But that gives whole lot of information where Originator requires only column information for a table.

    I feel using INFORMATION SCHEMA VIEWS or SP_COLUMNS will suffice.
    Originally posted by Ruprect
    okay i'll bite


    exec SP_Help tablename

    will give you everything about the table including all column names.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  13. #13
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    i was just jumpin' in
    info_schema are just fine

    or

    how about

    sp_columns
    Returns column information for the specified tables or views that can be queried in the current environment.

Posting Permissions

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