Advertisement
Guest User

Untitled

a guest
Sep 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 2.91 KB | None | 0 0
  1. SET QUOTED_IDENTIFIER OFF
  2. GO
  3. SET ANSI_NULLS ON
  4. GO
  5.  
  6. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SSS_StudentEnrollmentsDeleteFromWeb]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
  7. drop procedure [dbo].[SSS_StudentEnrollmentsDeleteFromWeb]
  8. GO
  9.  
  10.  
  11.  
  12. --Gayathri J, 5th Dec, 2004
  13. --Changed the proc to call Enrollments delete proc with appropriate parameters and removed the remaining code.
  14. /* COMMENTS FOR API
  15. Procedure Name: SSS_StudentEnrollmentsDeleteFromWeb
  16. Function Description : Used to delete enrollment records for self service.
  17. Parameters :
  18.     @lSSS_StudentEnrollmentsID  - Specifies the SSS_StudentEnrollments identifier
  19.     @UserGUID   - User GUID of the logged on user
  20.     @RespGUID   - Responsibility GUID of the user who has logged on
  21.     @lInstallationsID   - Specifies the installation in which the record has to be created
  22. END COMMENTS FOR API */
  23.  
  24. CREATE PROCEDURE   [dbo].SSS_StudentEnrollmentsDeleteFromWeb
  25. @lSSS_StudentEnrollmentsID  INT,
  26. @UserGUID                   UNIQUEIDENTIFIER,
  27. @RespGUID                   UNIQUEIDENTIFIER,
  28. @lInstallationsID           INT
  29.  
  30. AS
  31. BEGIN
  32. DECLARE
  33. @lPromotionOffStatusID      INT,
  34. @sPromotionOffStatusName    ShortString,
  35. @lWLHoldStatusID            INT,
  36. @sWLHoldStatusName          ShortString,
  37. @sIsWaitlisted              ShortString
  38.     SET NOCOUNT ON
  39.  
  40.     SET CONTEXT_INFO @UserGUID
  41.     SELECT
  42.         @lPromotionOffStatusID = CAST(IP.ProfileValue AS INT),
  43.         @sPromotionOffStatusName = S.Name
  44.     FROM   [dbo].CMN_InstallationProfiles IP
  45.         INNER JOIN   [dbo].CMN_Profiles P ON
  46.             P.CMN_ProfilesID = IP.CMN_ProfilesID
  47.         INNER JOIN   [dbo].CMN_Statuses S ON
  48.             S.CMN_StatusesID = CAST(IP.ProfileValue AS INT)
  49.     WHERE
  50.         P.ProfileName = 'SSS_WL_Promotion_Off_Status'
  51.         AND P.InstallationsID = @lInstallationsID
  52.  
  53.     SELECT
  54.         @lWLHoldStatusID = CAST(IP.ProfileValue AS INT),
  55.         @sWLHoldStatusName = S.Name
  56.     FROM   [dbo].CMN_InstallationProfiles IP
  57.         INNER JOIN   [dbo].CMN_Profiles P ON
  58.             P.CMN_ProfilesID = IP.CMN_ProfilesID
  59.         INNER JOIN   [dbo].CMN_Statuses S ON
  60.             S.CMN_StatusesID = CAST(IP.ProfileValue AS INT)
  61.     WHERE
  62.         P.ProfileName = 'SSS_WL_Promotion_Off_Hold_Release_Status'
  63.         AND P.InstallationsID = @lInstallationsID
  64.        
  65.      SELECT @sIsWaitlisted = IsWaitListed
  66.      FROM   SSS_StudentEnrollments
  67.      WHERE  SSS_StudentEnrollmentsID = @lSSS_StudentEnrollmentsID
  68.  
  69.     IF @sIsWaitlisted = 'Y'
  70.     BEGIN
  71.         EXEC   [dbo].SSS_StudentEnrollmentsDelete @lSSS_StudentEnrollmentsID = @lSSS_StudentEnrollmentsID,
  72.                                         @TStamp = NULL,
  73.                                         @UserGUID = @UserGUID,
  74.                                         @RespGUID = @RespGUID,
  75.                                         @lPromotionOffStatusID = @lPromotionOffStatusID,
  76.                                         @sPromotionOffStatusName = @sPromotionOffStatusName,
  77.                                         @lWLHoldStatusID = @lWLHoldStatusID,
  78.                                         @sWLHoldStatusName = @sWLHoldStatusName,
  79.                                         @TStampCheck = 'N',
  80.                                         @sFireAutoPromoteOff = 'Y'
  81.     END
  82. END
  83.  
  84.  
  85. GO
  86. SET QUOTED_IDENTIFIER OFF
  87. GO
  88. SET ANSI_NULLS ON
  89. GO
  90.  
  91. GRANT  EXECUTE  ON [dbo].[SSS_StudentEnrollmentsDeleteFromWeb]  TO [db_ExecAll]
  92. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement