Im using following procedure in one of my applications
ALTER procedure [dbo].[FeeRecordSelect]
@GRNo varchar(4),
@PaymentModeId numeric(2) output
as
begin
SELECT @PaymentModeId = Students.PaymentModeId FROM Students where Students.GRNo = @GRNo
end
GO
my question is: i want to select 1 in @PaymentModeId if I get no result for @GRNo
I Already have tried this
create procedure [dbo].[FeeRecordSelect10]
@GRNo varchar(4),
@PaymentModeId numeric(2) output
as
begin
SELECT @PaymentModeId = isnull(Students.PaymentModeId, 1) FROM Students where Students.GRNo = @GRNo
end
GO