So, you are in the MS-SQL Query Analyzer and are about ready to build a query but you don’t know all the column names.  So what do you do?  Well you could switch back and forth between the table designer or you could list all the column names from a table and cut and paste.  I have created the simple stored procedure below.  The procedure takes a table name as input and returns column names as results.

DownLoad Here :

ListTable.sql (1.67 kb)

Switch the query analyzer to display results in text and now you can copy cut and paste the columns that you need.


kick it on DotNetKicks.com