This is from a SQL Server book:
How is @Country working? Is the where clause reading WHERE Country LIKE @%? Thanks.
Code:
Use Northwind
GO
IF OBJECT_ID('dbo.ListCustomersByCity') IS NOT NULL
DROP PROC dbo.ListCustomersByCity
GO
CREATE PROCEDURE dbo.ListCustomersByCity @Country nvarchar(30)='%'
AS
SELECT City, COUNT(*) AS NumberOfCustomers
FROM Customers
WHERE Country LIKE @Country
GROUP BY City
GO
EXEC dbo.ListCustomersByCity
How is @Country working? Is the where clause reading WHERE Country LIKE @%? Thanks.