• Personally I'd use an IF statement:

    IF @LoanNumber IS NULL AND @DealershipName IS NULL

    BEGIN

    PRINT 'Both @LoanNumber and @DealershipName cannot be Null, a value must be entered for one of them.'

    END

    IF @LoanNumber IS NOT NULL

    BEGIN

    <SELECT statement to return dealership info>

    END

    ELSE IF @DealershipName IS NOT NULL

    BEGIN

    <SELECT statement to return all the loan numbers for the dealership>

    END

    -SQLBill