Look, I can get all of the cats if I don't hand in a parameter or I can hand in a parameter and get a cat by its Id!
ALTER procedure GetCats
@MyHandIn int = null
as
SET NOCOUNT ON;
SELECT Id, Name, NumberOfLives FROM Cats
WHERE iif(@MyHandIn is NULL, Id, @MyHandIn) = Id
No comments:
Post a Comment