View Single Post
  #8 (permalink)  
Old June 19th, 2003, 07:38 PM
Hal Levy Hal Levy is offline
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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?