none
Can one Stored Procedure return more than one table as a result RRS feed

  • Question

  • I have a table which is going to be returned by a Stored Procedure.

    I want to use a "SELECT DISTINCT" query to return an index of types in one of the columns.
    And it will only return that one column, no other data.
    This index will be used as a loop control in the main application.

    e.g. If there are several datarows with an "A" in that column "A" will be in the index once. I'm sure you all know how it works.

    I know how to do this as two seperate procedures but how can it be done by a single procedure?
    Phil M
    Thursday, June 25, 2009 11:39 AM

Answers

  • An SP can have more than one SELECT statement in it. This would return more than once.
    • Marked as answer by philipGM Thursday, June 25, 2009 11:51 AM
    Thursday, June 25, 2009 11:42 AM
    Moderator

All replies

  • An SP can have more than one SELECT statement in it. This would return more than once.
    • Marked as answer by philipGM Thursday, June 25, 2009 11:51 AM
    Thursday, June 25, 2009 11:42 AM
    Moderator
  • Thank you.
    I will now go and interogate the VB Forum until someone tells me how to handle the returned tables.
    I suspect it involves dataSets.
    Phil M
    Thursday, June 25, 2009 11:51 AM
  • look @ the nextrecordset Property

    dim rst1 as recordset
    dim rst2 as recordset

    Thursday, June 25, 2009 1:13 PM