So, today one of my friends asked me if I knew how to return the names of all the fields in a table using a stored procedure so that he could build the names into a generic string collection. This is how you do it:
Select For Unformatted Code
SQL: CREATE
Read More...
Read the complete post at http://www.sharepointsecurity.com/blog/sharepoint/sharepoint-2007-development/returning-table-field-names/