Prasad Bhagat

Prasad Bhagat

  • NA
  • 516
  • 234.8k

how to return multiple output values from stored proc?

Aug 28 2015 11:43 AM
Dear all,
 
i have a stored proc like bellow
 
ALTER PROCEDURE [dbo].[xyz]
@ds VARCHAR(20),
@sdVARCHAR(10),
@ds VARCHAR(100),
@sds VARCHAR(100),
@dds VARCHAR(20),
@dds VARCHAR(200)
AS
BEGIN
BEGIN TRY
IF (SELECT COUNT(*) FROM dbo.abc
WHERE Number = @Number
AND CountryCode = @CountryCode
AND Token=@Token) > 0
BEGIN
SELECT 'Already registered' AS STATUSMSG, -1 AS STATUSIND
END
ELSE
BEGIN
INSERT INTO dbo.avbc
(ss,
sasa,
ss,
sa,
ss,
Token,
AddedDate)
VALUES
(@as,
@sasa,
@ss,
@ssa,
@ssa,
@sas,
GETDATE())
SELECT 'asadashdiu' AS STATUSMSG, 1 AS STATUSIND
END
END TRY
BEGIN CATCH
SELECT ERROR_MESSAGE() AS STATUSMSG, -1 AS STATUSIND
END CATCH
END
 
now i want retun status message and status to my c# code
how to retun these two values
please help me 

Answers (1)