ALTER PROCEDURE testme @input VARCHAR(10),
@output VARCHAR(20) output
AS
BEGIN
IF @input >= '1'
BEGIN
SET @output = 'i am back';
RETURN;
END
END
DECLARE @get VARCHAR(20);
EXEC testme
'1',
@get output
SELECT @get
CREATE PROCEDURE [endicia].[credentialLookup]
@accountNumber varchar(20),
@login varchar(20) output,
@password varchar(50) output
AS
BEGIN
SET NOCOUNT ON;
SELECT top 1 @login = [carrierLogin],@password = [carrierPassword]
FROM [carrier_account] where carrierLogin = @accountNumber
order by clientId, id
END
Try for the result:
SELECT *FROM [carrier_account]
DECLARE @login varchar(20),@password varchar(50)
exec [endicia].[credentialLookup] '588251',@login OUTPUT,@password OUTPUT
SELECT 'login'=@login,'password'=@password
CREATE PROCEDURE DBO.MY_STORED_PROCEDURE
(@PARAM1VALUE INT,
@PARAM2VALUE INT,
@OUTPARAM VARCHAR(20) OUT)
AS
BEGIN
SELECT * FROM DBO.PARAMTABLENAME WHERE PARAM1VALUE=@PARAM1VALUE
END
DECLARE @OUTPARAM2 VARCHAR(20)
EXEC DBO.MY_STORED_PROCEDURE 1,@OUTPARAM2 OUT
PRINT @OUTPARAM2