Stored Procedure Columns

From: POLLJOH (anonymous_at_discussions.microsoft.com)
Date: 05/28/04


Date: Fri, 28 May 2004 05:11:02 -0700

Using ADO from VBA I am running stored procedures in SQL Server 2000 and copying the returned recordset to an Excel ***. The problem is I want to insert the column names also (I do not want to hard code these since I am using a generic wrapper which just accepts the stored procedure name and can be used to run any sproc in the database). I searced all the catalog system stored procedures and although there is a sp_sproc_columns it does not return the column names.

At this stage I am faced with writing a parsing routine which could use sp_HelpText to extract the column names or creating a table with the column names in but I want to avoid any of these if there is an easier alternative .

Any help would be much appreciated.

Regards
JOHN