Here's psuedo-code for the stored procedure I currently use,
CREATE PROC uspFoo
(
@id int,
@type nvarchar(255),
@status bit output
)
AS
IF ....
SET @status=1
ELSE
SET @status=0
GO
When executing this stored procedure, I am forced to pass an output parameter that will store its return value,
DECLARE @id int, @type nvarchar(255), @status bit
SET @id=..
SET @type=..
EXEC uspFoo @id, @assayType, @status output
PRINT @status
GO
The return value, or in this case status, will either be 0 (false) or 1 (true).
How can I return a value (e.g. bit) directly without having to store it in a temporary output parameter?