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: 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
ADECLARE @CountCustomers int
EXEC CountOfCustomers @City = 'Berlin', @CountCus = @CountCustomers;
BDECLARE @CountCustomers int
EXEC CountOfCustomers @City = 'Berlin', @CountCus = @CountCustomers OUTPUT;
CEXECUTE CountOfCustomers 'Berlin', @CountCus = @CountCustomers OUTPUT;
DDECLARE @CountCustomers int
EXEC CountOfCustomers @CountCus = @CountCustomers OUTPUT;