How to return some data from a stored SQL Server process?

I need to make two queries in two different tables, and the data is not actually related. Therefore, when I call a stored procedure through my code, I have to get a DataSet with two DataTables, one DataTable for each request. How is this done in SQL Server stored procedures?

+4
source share
1 answer

Just execute two SELECT statements in proc:

SELECT * FROM Foo SELECT * FROM Bla 

when you then fill out () the data set, you will get two types of data: one with the first set of results, the second with the second.

+10
source

All Articles