I have a Stored Procedure which executes some dynamic SQL. I want to use this Stored Procedure in entity framework 4, but when I try to create a complex type the procedure r
try this
CREATE PROCEDURE sp_calculatesalary(@EmployeeId as int)
AS
DECLARE @dynsql VARCHAR(500)=' Salary,Username FROM employee WHERE EmployeeId=@empID'
EXEC sp_executesql @dynsql,'@empID INT',@empID=@EmployeeID
SELECT 1 AS salary,2 AS username
Believe me. That is enough.
Or you can simply create a complex type based on your query result , and then use collection of the complex type as your query result.