SQL Interview: 43 No return value from calling procedure
This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Developer Level: Intro
Question:
You want to call a procedure that counts the number of customers in a particular city.
You use the following code:
DECLARE @NumberOfCustomers int;
EXEC dbo.GetNumberOfCustomers
@City = N'Brisbane',
@NumberOfCustomers = @NumberOfCustomers;
SELECT @NumberOfCustomers;
No matter which city name you pass in the code, the selected count is NULL.
2025-05-04