Here is a paste of the procedure:
CREATE PROCEDURE Gw_Select_Categories
@CategoryId int
AS
IF @CategoryID = -1
SELECT CategoryId, Description, Notes, ParentCategoryId FROM Categories Order by Description
ELSE
SELECT CategoryId, Description, Notes, ParentCategoryId FROM Categories WHERE ParentCategoryId = @CategoryId ORDER BY Description
GO
|