Questions tagged [multiple-resultsets]
103 questions
99
votes
4 answers
Dapper.NET and stored proc with multiple result sets
Is there any way to use Dapper.NET with stored procs that return multiple result sets?
In my case, the first result set is a single row with a single column; if it's 0 then the call was successful, and the second result set will contain that actual…

marc_s
- 732,580
- 175
- 1,330
- 1,459
31
votes
1 answer
How to read multiple resultset from SqlDataReader?
I have a SP from that I am trying to return 2 result set from, and in my .cs file i am trying something like this:
dr = cmd.ExecuteReader();
while (dr.Read())
{
RegistrationDetails regDetails = new RegistrationDetails()
{
FName =…

Rocky
- 4,454
- 14
- 64
- 119
26
votes
2 answers
How to pull back all parent/child data in complex object
I have these two tables with a one (category) to many (product) relationship in the database:
Table Product
Name
Description
ProductCategory
Table Category
Category
Description
And these classes:
public class Product
{
…

LRP
- 283
- 1
- 3
- 5
15
votes
3 answers
Linq to SQL Stored Procedures with Multiple Results
We have followed the approach below to get the data from multiple results using LINQ To SQL
CREATE PROCEDURE dbo.GetPostByID
(
@PostID int
)
AS
SELECT *
FROM Posts AS p
WHERE p.PostID = @PostID
SELECT c.*
FROM…
Gourav
11
votes
1 answer
Entity Framework CTP5 - Reading Multiple Record Sets From a Stored Procedure
In EF4, this was not easily possible. You either had to degrade to classic ADO.NET (DataReader), use ObjectContext.Translate or use the EFExtensions project.
Has this been implemented off the shelf in EF CTP5?
If not, what is the recommended way…

RPM1984
- 72,246
- 58
- 225
- 350
9
votes
1 answer
Retrieve multiple result sets in sails js
I am using sails js with it sails-mssqlserver adapter. The problem with it is that if my stored procedure returns multiple result sets then I only receive one result set which is the latest of all.
The same stored procedure is working fine with…

TGW
- 805
- 10
- 27
8
votes
2 answers
JDBC : returning multiple result sets via a single database invocation - not working for Oracle
This post showed executing multiple queries in a single JDBC invocation (against a SQL Server database) by separating them with semicolons. When I tried to do the same with Oracle 10G, an error "invalid character" propped up :
class db
{
public…

Daud
- 7,429
- 18
- 68
- 115
6
votes
1 answer
Entity Framework Query Results Duplicate
I created a SQL View that joins a few tables and when tested in SQL
Manager it provides the correct data (If a makes a difference these are complex joins).
In MVC I created a (data first) Entity Data Model and then added code
generation.
I have a…

Pete
- 2,393
- 2
- 24
- 31
4
votes
1 answer
One-to-Many with no back reference in sub-related entity
If I have one-to-many relation between two entities (ie. Post and Comment) and have my master class defined as:
public class Post {
...
IList Comments { get; set; }
}
But my Comment sub-related class doesn't have a property of type…

Robert Koritnik
- 103,639
- 52
- 277
- 404
4
votes
1 answer
BLToolkit: Multiple resultsets?
I haven't found a way to retrieve two lists of objects from an SP with two select statements.
Is it possible with BLToolkit, or can only hierarchical data be fetched in such a manner?
I'm trying to replace a dataset containing two unrelated tables.

Carl R
- 8,104
- 5
- 48
- 80
4
votes
1 answer
Returning Multiple Resultset in a single Stored Procedure is a good practice
I'm having a Stored Procedure in SQL Server it contains Multiple Resultset (i.e., It contains multiple SELECT Statement). Its a good practice of programming ?
For Example:
I have a Person and a Person_Address table.
Create table: Person
CREATE TABLE…
user6060080
4
votes
2 answers
Trying to load second result set from a stored procedure
I have a customer setup that uses stored procedures to return data from its SQL Server database.
Those stored procedures are all built the same way - they take a bunch of input parameters, and they return:
the first is just a single row, single…

marc_s
- 732,580
- 175
- 1,330
- 1,459
3
votes
2 answers
TSQL equivalent of PostgreSQL "PERFORM" keyword?
I'm testing query performance in a loop. Rather than return a hundred duplicates of a result set, I want to run a select statement hundreds of times, discarding the results each time.
PostgreSQL has the syntax "perform select...", which will…

Triynko
- 18,766
- 21
- 107
- 173
3
votes
1 answer
MyBatis multiple resultsets
I am currently migrating code from iBatis 2 to MyBatis 3. I have a function that returns multiple results sets which we map to different classes. In iBatis we where able to map the different results using a comma separated list int the resultType…

James Woods
- 477
- 1
- 4
- 15
3
votes
3 answers
Hibernate: Multiple Result Sets
from what I've read in the Hibernate documentation/online it sounds like Hibernate does not have the ability to handle multiple result sets. I'm looking to make a MySQL DB call in an application that relies on Hibernate, that will return multiple…

Ryan P.
- 855
- 2
- 14
- 20