Bug with new experimental feature of Multiple Result Sets from a stored procedure
See original GitHub issueI am trying the new experimental feature of Multiple Result Sets from a stored procedure. This worked great for me with a couple of small things below.
Steps to reproduce
I created a simple stored procedure that returned 3 different result sets back in one call. No input parameters.
- The generated code did not include the Dapper package for me–no big deal, just unexpected. This may be out-of-band and just need to be documented.
- I included a non-multi stored procedure with the test and it happens to include an
nvarchar
in it’s result set. This fails code generation if the experimental feature is on, but works if it is off.Unable to get result set shape for PROCEDURE 'dbo.Blahblahblah' Operand type clash: nvarchar is incompatible with Blahblahblah
- I was a but surprised that this returns multiple
List<>
variables. This will not be a problem for the code I write, but if someone has a very large result set, this may pose a memory issue. Normally a DataReader of some sort is used.
Further technical details
EF Core version in use: EF Core 6
EF Core Power Tools version: 2.5.863.0
Database engine: SQL Server 2019 Standard Edition
Visual Studio version: Visual Studio 2022
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Support multiple result sets from a SQL Server Stored ...
Create a stored procedure that issues two different result sets. Run this tool to bring it in and you will only see the...
Read more >Using JPA with stored procedures that return multiple result ...
Is it possible to handle multiple result sets having different columns from a stored procedure in SQL Server using JPA?
Read more >Stored proc returning multiple result sets - I need just ONE!
The problem, for me, at least, occurs when the stored procedure returns multiple result sets. Sometimes upwards of 25 result sets are returned....
Read more >Stored Procedures with Multiple Result Sets - EF6
In order to get multiple result sets working we need to drop to the ObjectContext API by using the IObjectContextAdapter interface. Once we ......
Read more >Stored procedures and multiple result sets in T-SQL
In T-SQL it's just impossible to access multiple result sets if stored procedure returns them.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
List<>
s anyway–you’ve just done it for me.@ErikEJ Personally, I’m fine with not being able to have the SchemaOnly table valued parameters.
I have better ways of dealing with passing in tables of data to a stored procedure (better from the standpoint of having a c# app calling the sproc at least). As long as there’s not to much volume of data I usually pass in a JSON string and have SQL decode the JSON. Even then, I only typically do that for things like when I have a variable, but small number, of items I need to write a filter for. Say the user wants to filter on certain product numbers and they get to choose which ones, etc.