Stored procedure having temporary table declaration needs to be replaced with TABLE variable declaration.
e.g.
CREATE Procedure spDoSomethingAmazing
AS
BEGIN
CREATE TABLE #Temp (ID INT, Name VARCHAR(50)
INSERT INTO #Temp
SELECT
ID, Name
FROM
TestTable
SELECT ID, Name #Temp
DROP TABLE #Temp
END
-- Modified version of Stored procedure so Entity Framework can generate Complex Type
CREATE Procedure spDoSomethingAmazingForEF
AS
BEGIN
DECLARE @Temp TABLE (ID INT, Name VARCHAR(50)
INSERT INTO @Temp
SELECT
ID, Name
FROM
TestTable
SELECT ID, Name @Temp
END
No comments:
Post a Comment