[RESOLVED] Multiple Selects in Stored Proc SQL 2000
Not sure if this would be better handled in the vb.net section but here goes.
Is there a way that I could call a single stored procedure that has multiple selects in it and easily assign them to their own datatable within a dataset?
So one stored procedure would be basically the datasource for multipe datatables?
Or should I just stop being lazy and break them up?
Thanks
Blah wrong forum... please move to database section
Re: Multiple Selects in Stored Proc SQL 2000
Quote:
Originally Posted by Besoup
Blah wrong forum... please move to database section
Done. :D
Re: Multiple Selects in Stored Proc SQL 2000
Quote:
Originally Posted by Besoup
Is there a way that I could call a single stored procedure that has multiple selects in it and easily assign them to their own datatable within a dataset?
So one stored procedure would be basically the datasource for multipe datatables?
yes you can do that,the only thing is your datatables name in dataset will be Table1 table2 etc. which u can easily change using
dsMyDataset.Tables(0).TableName="MyTable1" :thumb:
Re: Multiple Selects in Stored Proc SQL 2000
so call it just like normal and expect more tables?
Re: Multiple Selects in Stored Proc SQL 2000
yes just call SPOC as
Code:
Dim dsMyDataSet As New DataSet("MySet")
Dim daSQL As New SqlDataAdapter("USP_SELECT_TABLE", "Connection")
daSQL.SelectCommand.CommandType = CommandType.StoredProcedure
daSQL.Fill(dsMyDataSet)
Re: Multiple Selects in Stored Proc SQL 2000
Thanks alot... that's way too easy. :P