Change it to this and let me know what happens:
Code:
CREATE PROCEDURE Gw_Select_Categories
@CategoryId int = -1
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
Hal Levy
NOT a Wiley/Wrox Employee- Got a job for me?