Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
704 B

  1. SET QUOTED_IDENTIFIER ON
  2. GO
  3. SET ANSI_NULLS ON
  4. GO
  5. CREATE PROCEDURE sp_CategorizeBuckets
  6. @ip_Followup varchar(50),
  7. @ip_SortBy varchar(100)
  8. AS
  9. BEGIN
  10. -- sort by bucketid
  11. IF (@ip_SortBy = 'BucketId' OR @ip_SortBy = 'Bucket')
  12. BEGIN
  13. select BucketId,
  14. Instances,
  15. BugId AS Bug
  16. from BucketCounts
  17. WHERE Followup = @ip_Followup
  18. order by BucketId
  19. END
  20. -- sort by #Instances
  21. IF (@ip_SortBy = 'Instances')
  22. BEGIN
  23. select BucketId,
  24. Instances,
  25. BugId AS Bug
  26. from BucketCounts
  27. WHERE Followup = @ip_Followup
  28. order by Instances DESC
  29. END
  30. END
  31. GO
  32. SET QUOTED_IDENTIFIER OFF
  33. GO
  34. SET ANSI_NULLS ON
  35. GO