Опитайте това, елегантно е :)
ALTER PROCEDURE [dbo].[usp_return_countries]
@CountryID AS INT = 0
AS
BEGIN
SELECT *
FROM Countries
WHERE Active = 1
AND (@CountryID = 0 OR @CountryID = CountryID)
END
Опитайте това, елегантно е :)
ALTER PROCEDURE [dbo].[usp_return_countries]
@CountryID AS INT = 0
AS
BEGIN
SELECT *
FROM Countries
WHERE Active = 1
AND (@CountryID = 0 OR @CountryID = CountryID)
END