title: Stored Procedures Difficulty
body: <p>I'm using SQL Server and I'm stuck on a problem. Any help would be appreciated! </p>
  
  <p>Using the AP database create a stored procedure called <code>spFindInvoices</code> that accepts two parameters: <code>@NameVendor</code> of type <code>varchar</code> and <code>@BalanceLimit</code> of type <code>smallmoney</code>. </p>
  
  <p>This procedure displays the VendorName, InvoiceNumber, InvoiceDueDate and Balance of @NameVendor where the balance is greater than @BalanceLimit. If you call/test the procedure with <code>@NameVendor = ‘Federal Express Corporation’</code> and <code>@BalanceLimit = 0</code>, the following table will be displayed:</p>
  
  <pre><code>(my code)
  USE AP;
  GO
  
  CREATE PROC spInvoices
       @NameVendor VARCHAR(50),
       @BalanceLimit SMALLMONEY
  AS
      SELECT 
          VendorName, InvoiceNumber, InvoiceDueDate, 
          (InvoiceTotal - CreditTotal - PaymentTotal) AS Balance
      FROM 
          Invoices 
      JOIN 
          Vendors ON Invoices.VendorID = Vendors.VendorID
      WHERE 
          @NameVendor &gt; @BalanceLimit
  GO
  
  EXEC spFindInvoices @NameVendor = 'Federal Express Corporation',
                      @BalanceLimit = '0' 
  </code></pre>