DBI202Xuất hiện trong 1 đề thi
The following SQL statement creates a stored procedure that count number of customers in each City from the "Customers" table: ```sql CREATE PROCEDURE CountOfCustomers @City nvarchar(30), @CountCus int OUTPUT AS SET @CountCus = ( SELECT COUNT(CustomerID) FROM Customers WHERE City = @City GROUP BY City ) GO; ``` Which of the following is the way to execute a procedure?
Các lựa chọn
A```sql
DECLARE @CountCustomers int
EXEC CountOfCustomers @City = 'Berlin', @CountCus = @CountCustomers;
```
B```sql
DECLARE @CountCustomers int
EXEC CountOfCustomers @City = 'Berlin', @CountCus = @CountCustomers OUTPUT;
```
C```sql
EXECUTE CountOfCustomers 'Berlin', @CountCus = @CountCustomers OUTPUT;
```
D```sql
DECLARE @CountCustomers int
EXEC CountOfCustomers @CountCus = @CountCustomers OUTPUT;
```