evilmousse
Programmer
What follows is a simple stored procedure that's
not behaving as I expected.
----begin sp--------
ALTER PROCEDURE procTest (
@p_loan_number varchar(10)
) AS
SET NOCOUNT ON
IF (SELECT dbo.t_loan.loan_number FROM dbo.t_loan WHERE dbo.t_loan.loan_number = @p_loan_number) is null BEGIN
select dbo.t_mando.trade_id from dbo.t_mando
END
ELSE BEGIN
select dbo.t_loan.loan_number from dbo.t_loan
END
SET NOCOUNT OFF
----end sp----
now, when i enter junk data into the dialog prompt
for the parameter, i get the appropriate trade_id
column. however, when i enter an existing loan_number,
instead of getting the loan_number column, i get
a trade_id column, filled completely with "#Name?".
i've gotta be missing something simple.
-g