Executing SQL Stored Procedure with Output Parameter from Entity Framework
问题 Using EF, I'm trying to execute a stored procedure that returns a single string value, i.e. the status of an SQL Agent Job. The stored procedure is declared as CREATE PROCEDURE [dbo].[up_GetJobStatus](@JobStatus NVARCHAR(30) OUTPUT) AS -- some code omitted for brevity SELECT @JobStatus = ( SELECT CASE job_state WHEN 1 THEN 'Executing' WHEN 2 THEN 'Waiting for thread' WHEN 3 THEN 'Between retries' WHEN 4 THEN 'Idle' WHEN 5 THEN 'Suspended' WHEN 6 THEN '<unknown>' WHEN 7 THEN 'Performing