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.

142 lines
3.8 KiB

  1. /****** Object: Stored Procedure dbo.CheckForSolution Script Date: 5/17/2002 5:59:28 PM ******/
  2. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_CheckForSolution]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  3. drop procedure [dbo].[sp_CheckForSolution]
  4. GO
  5. /****** Object: Stored Procedure dbo.OCAV3_GetSolutionData Script Date: 5/17/2002 5:59:28 PM ******/
  6. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OCAV3_GetSolutionData]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  7. drop procedure [dbo].[OCAV3_GetSolutionData]
  8. GO
  9. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetBucketSolution]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  10. drop procedure [dbo].[sp_GetBucketSolution]
  11. GO
  12. SET QUOTED_IDENTIFIER OFF
  13. GO
  14. SET ANSI_NULLS OFF
  15. GO
  16. CREATE PROCEDURE dbo.sp_CheckForSolution
  17. @strSBucket varchar(100),
  18. @strDriver varchar(50),
  19. @iTimeStamp int,
  20. @strGBucket varchar(100),
  21. @bForcegBucket int
  22. AS
  23. BEGIN
  24. DECLARE @i_Solution int
  25. DECLARE @i_SolType tinyint
  26. DECLARE @i_gSolution int
  27. -- Lookup solution with bucket string, return bucketid
  28. SELECT @i_Solution = solutionid FROM SolvedBuckets WHERE BucketID = @strSBucket
  29. if ((@i_Solution IS NULL) OR (@bForcegBucket != 0))
  30. BEGIN
  31. SELECT @i_gSolution = solutionid FROM SolvedBuckets WHERE BucketID = @strGBucket
  32. END
  33. if (NOT (@i_Solution IS NULL))
  34. BEGIN
  35. SELECT @i_SolType = SolutionType FROM SolutionEx WHERE SolutionId = @i_Solution
  36. END
  37. if (@i_Solution IS NULL)
  38. BEGIN
  39. SET @i_Solution = 0
  40. SET @i_SolType = 0
  41. END
  42. IF (@i_SolType IS NULL)
  43. SET @i_SolType = 0
  44. IF (@i_gSolution IS NULL)
  45. SET @i_gSolution = 0
  46. SELECT @i_Solution AS SolutionId, @i_SolType AS SolutionType, @i_gSolution AS gSolutionId
  47. END
  48. GO
  49. SET QUOTED_IDENTIFIER OFF
  50. GO
  51. SET ANSI_NULLS ON
  52. GO
  53. SET QUOTED_IDENTIFIER OFF
  54. GO
  55. SET ANSI_NULLS OFF
  56. GO
  57. -- 6/4/02 Solson: If no solution is found with the language specified then switch to en
  58. -- 6/7/02 SOlson: Removed unused company contact information, also added lang to templates so this query changed
  59. -- 6/27/02 SOlson: Added CompanymainPhone back into result set BUG 651397
  60. CREATE PROCEDURE OCAV3_GetSolutionData(
  61. @SolutionID int,
  62. @Language nvarchar(4) = 'en'
  63. ) AS
  64. IF ( @Language <> 'en' )
  65. BEGIN
  66. IF NOT EXISTS (
  67. SELECT * FROM SolutionEx as SolEx INNER JOIN Templates on SolEx.TemplateID = Templates.TemplateID
  68. where SolutionID = @SolutionID AND Lang = @Language
  69. )
  70. SET @Language = 'en'
  71. END
  72. SELECT T.Description,
  73. SolEx.Description as KBArticles,
  74. ProductName,
  75. CompanyName,
  76. CompanyWebSite,
  77. CompanyMainPhone,
  78. ModuleName
  79. FROM SolutionEx as SolEx
  80. INNER JOIN Templates as T on T.TemplateID = SolEx.TemplateID
  81. left join Products as P on SolEx.ProductID = P.ProductID
  82. left join Contacts as C on SolEx.ContactId = C.ContactID
  83. left join Modules as M on SolEx.ModuleId = M.ModuleID
  84. where SolutionID = @SolutionID and Lang = @Language
  85. GO
  86. SET QUOTED_IDENTIFIER OFF
  87. GO
  88. SET ANSI_NULLS ON
  89. GO
  90. SET QUOTED_IDENTIFIER ON
  91. GO
  92. SET ANSI_NULLS ON
  93. GO
  94. CREATE PROCEDURE sp_GetBucketSolution(
  95. @sBucketID varchar (100),
  96. @gBucketID varchar (100)
  97. ) AS
  98. BEGIN
  99. SELECT sol.SolutionType, sol.Description
  100. FROM SolvedBuckets inner join SolutionEx as sol
  101. on SolvedBuckets.BucketId = @sBucketId AND
  102. sol.SolutionId = SolvedBuckets.SolutionId
  103. END
  104. GO
  105. SET QUOTED_IDENTIFIER OFF
  106. GO
  107. SET ANSI_NULLS ON
  108. GO
  109. GRANT EXECUTE ON [dbo].[sp_CheckForSolution] TO [OcaDebug]
  110. GO
  111. GRANT EXECUTE ON [dbo].[OCAV3_GetSolutionData] TO [Web_RO]
  112. GO
  113. GRANT EXECUTE ON [dbo].[sp_GetBucketSolution] TO [OcaDebug]
  114. GO