Returning Table Field Names

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:


CREATE PROCEDURE [dbo].[GetColumnNames] @tableName VARCHAR(50)
SELECT  name
FROM    syscolumns
WHERE   id = OBJECT_ID(@tableName)


Easy as pie! :)