locked
DISPLAY COLUMN NAMES AND TABLE NAMES RRS feed

  • Question

  • HI,

    HOW TO:

              DISPLAY ALL THE COLUMNS FROM A TABLE?

              ADD PARAMETERS TO DISPLAY A SPECIFIC COLUMN?

    EXAMPLE: SELECT @COLUMN FROM @TABLE

    Friday, February 10, 2006 3:31 AM

Answers

  • Please don't shout ( i.e. don't write in all caps ).

    Sadly, for the second option, you need to build a SQL string and execute it, you can't write a stored proc that takes a column name as a parameter.  You can build the string in a stored proc and call sp_exec tho.

     

    Friday, February 10, 2006 3:40 AM