Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Returning more than one Record from SP...

Hi ,

Is there a way in SQL Server stored procedure to return multiple records/ more than one records....?

Thanks in Advance...

-Mohit.


Comments

  • HackmanCHackmanC Member Posts: 441
    In the stored procedure...

    [code]
    create procedure myproc
    (
    @x int
    ) as
    select * from table1 where id1=@x
    select * from table2 where id2=@x
    [/code]

    in ado, to retrive the records...
    [code]
    dim cn as new adodb.connection
    dim rs as new adodb.recorset

    cn.open "xxxx"
    rs.open "myproc 1"
    debug.print rs.fields("id1")
    set rs = rs.nextrecordset
    debug.print rs.fields("id2")

    ...
    [/code]

    ---
    : Hi ,
    :
    : Is there a way in SQL Server stored procedure to return multiple records/ more than one records....?
    :
    : Thanks in Advance...
    :
    : -Mohit.
    :
    :
    :

    [red]Good luck![/red]
    [blue]Hackman[/blue]

Sign In or Register to comment.