Question: Using the AP database create a procedure called spBalance which accepts two optional parameters @BalanceMin and @BalanceMax of type smallmoney with default values of NULL.

Using the AP database create a procedure called spBalance which accepts two optional parameters @BalanceMin and @BalanceMax of type smallmoney with default values of NULL. In the procedure, write a query that counts the total number of invoices in the Invoices table within the @BalanceMin and @BalanceMax values and returns the count value. In the procedure, also add the following- if @BalanceMin is NULL, set @BalanceMin to 0. If @BalanceMax is NULL or 0, set it to the maximum balance in the Invoices table. Code two EXEC statements that call/test the procedure with the following arguments and print the return value: No arguments are provided (The return value should be 10) and @BalanceMin is 500 and @BalanceMax is 1000 (The return value should be 2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!