Fetching record set using stored procedure

  • There are 3 queries

    select @from,@to from table1

    there contains list of values for @from & @to

    For each of the @from & @to values should be passed another queries like this

    select @id from table2 where column=@from and column2=@to

    (here again i wil get set of values for @id)

    this @id i need to pass it to another query

    BELOW IS THE FINAL QUERY

    select column1,column2,column3 from table where column1@=@id

    If i use stored procedure with a cursor i will get multiple result set,but i want in single result set.

    can anyone help?

  • Please explain what you'retrying to achieve (not in terms of SQL code but in terms of the related business case).

    As per now to me the concept looks weird... There are most probably different (= easier to maintain and/or better performing) solutions.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • I have to do one report in reporting services so

    I want that result set to render in report using reporting service

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply