FancyPrairie
Programmer
I'm trying to determine the fields within the Select statement of a stored procedure. I've done it with a view by adding the Where clause 1=2 to it (i.e. Select * from Query1 Where 1=2). Although it does not return any records, I can open the recordset and loop through the fields to get their names.
But I'm not sure how to do this with a stored procedure. I figured if I could extract the Select statement from the procedure then I could do what needs to be done. I tried opening a recordset like this: rst.Open "sp_helptext 'storedprocedurename'...
Although I get the select statement, I get the entire definition of the procedure, which could get rough trying to strip out everything but the Select statement.
So, is there some way to extract the Select statement from a stored procedure? Or, better yet, retrieve the names of the fields within the Select statement?
But I'm not sure how to do this with a stored procedure. I figured if I could extract the Select statement from the procedure then I could do what needs to be done. I tried opening a recordset like this: rst.Open "sp_helptext 'storedprocedurename'...
Although I get the select statement, I get the entire definition of the procedure, which could get rough trying to strip out everything but the Select statement.
So, is there some way to extract the Select statement from a stored procedure? Or, better yet, retrieve the names of the fields within the Select statement?