Ability to reverse engineer stored procedures using temp tables.
See original GitHub issuePerhaps this is a known issue, and in that case apologies… It would be nice to have the ability to reverse engineer stored procedures that create and use temp tables. When I Reverse Engineer a database with stored procedures that include a temp table, the extension throws an error:
The metadata could not be determined because statement ‘INSERT #x (something, somethingelse) SELECT ‘wow’, GETDATE()’ in procedure ‘test’ uses a temp table. Unable to scaffold UpdateIncomingSpec
Steps to reproduce
- Reverse Engineer a database
- include stored procedures
- use a stored procedure that includes a temp table.
- example sproc:
CREATE PROC [dbo].[test]
@DetailID INT,
@returnCode INT OUTPUT,
@result VARCHAR (MAX) OUTPUT
AS
SET NOCOUNT ON
CREATE TABLE #x (
something VARCHAR (MAX) NOT NULL,
somethingelse VARCHAR (MAX) NOT NULL
);
INSERT #x (something, somethingelse)
SELECT 'wow', GETDATE()
BEGIN
SELECT @ReturnCode = 0, @Result = '';
END
DROP TABLE #x;
GO
Further technical details
EF Core Power Tools version: 2.4.236.0
Database engine: SQL Server
Visual Studio version: VS2019 16.7.5
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Mapping and using SQL Server stored procedures with EF ...
First two select statements put data into temp tables and the third ... Using EF core power tool reverse engineering for accessing stored...
Read more >Using temporary tables in stored procedure - Ask TOM - Oracle
Using temporary tables in stored procedure Hi Tom,I am used to use MS SQL Server or Sybase to create stored procedures for reporting....
Read more >EF can't infer return schema from Stored Procedure ...
Solution 1 Use a table variable instead of a temporary table. Solution 2 Use the Set FMTONLY off; SQL command in the procedure...
Read more >Temp Tables vs Variable Tables — SQL Data Preparation
Variable tables are only designed to hold small amounts of data. A concept for another day involves execution plans which, for example, a...
Read more >External Temp Tables Preventing Plan Reuse in Stored ...
Because we're now using a table type, SQL will know the schema and if our theory to this point holds water, should be...
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
Fixed in latest daily build
There is no fix, but an empty result class is created, and you can manually add the properties.