Is there a way via metadata (Information_Schema, perhaps?) to get a list of the columns a sproc will return? I\'m trying to automate some code generation and that would help
My way of doing this: Edit the stored procedure to have an INTO clause:
Change
Select * from tablename
to
Select * INTO _tablename FROM tablename
This creates a table in the database.
Then, use SELECT * FROM INFORMATION_SCHEMA WHERE TABLE_NAME = '_tablename'
Don't forget to undo the modification to the sproc.