Kizspy Question: 49
(Choose 1 answer)
The following SQL statement creates a stored procedure that count number of customers in each City from
the "Customers" table:
CREATE PROCEDURE CountOfCustomers
@City nvarchar(30), @CountCus int OUTPUT
AS
SET @CountCus = (
SELECT COUNT(CustomerID) FROM Customers
WHERE City
GROUP BY City
= @City
Which of the following is the way to execute a procedure?
A. DECLARE @CountCustomers int
EXEC CountOfCustomers @City = 'Berlin', @CountCus= @CountCustomers;
B. DECLARE @CountCustomers int
EXEC CountOfCustomers @City = 'Berlin', @CountCus= @CountCustomers OUTPUT;
C. EXECUTE CountOfCustomers 'Berlin', @CountCus= @CountCustomers OUTPUT;
D. DECLARE @CountCustomers int
EXEC CountOfCustomers @CountCus= @CountCustomers OUTPUT;