Follow

Stored Procedure to Delete a ScormRegistration (v.2011.1)

Avatar

SQL Server STORED PROCEDURE:


CREATE PROCEDURE dbo.usp_scorm_DeleteRegistration
    (
        @scorm_registration_id int
    )
AS
    SET NOCOUNT ON
    
    DELETE ScormActivityRTComment FROM ScormActivityRTComment a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id
    DELETE ScormActivityRTObjective FROM ScormActivityRTObjective a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id
    DELETE ScormActivityRTIntCorrectResp FROM ScormActivityRTIntCorrectResp a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id
    DELETE ScormActivityRTIntObjective FROM ScormActivityRTIntObjective a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id
    DELETE ScormActivityRTIntLearnerResp FROM ScormActivityRTIntLearnerResp a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id
    DELETE ScormActivityRTInteraction FROM ScormActivityRTInteraction a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id    
    DELETE ScormActivityRT FROM ScormActivityRT a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id    
    DELETE ScormActivityObjective FROM ScormActivityObjective a INNER JOIN ScormActivity b ON a.scorm_activity_id = b.scorm_activity_id WHERE
        b.scorm_registration_id = @scorm_registration_id
    
    UPDATE ScormRegistration SET suspended_activity_id = NULL WHERE scorm_registration_id = @scorm_registration_id
    
    DELETE FROM ScormActivity WHERE scorm_registration_id = @scorm_registration_id
    DELETE FROM ScormLaunchHistory WHERE scorm_registration_id = @scorm_registration_id
    DELETE FROM ScormRegistrationGlobalObj WHERE scorm_registration_id = @scorm_registration_id
    DELETE FROM ScormRegistrationSSPBucket WHERE scorm_registration_id = @scorm_registration_id
    DELETE FROM ScormRegistrationSharedData WHERE scorm_registration_id = @scorm_registration_id
    DELETE FROM ScormRegistrationSharedDataVal WHERE scorm_registration_id = @scorm_registration_id
    DELETE FROM ScormAiccSession WHERE scorm_registration_id = @scorm_registration_id
    DELETE FROM ScormRegistration WHERE scorm_registration_id = @scorm_registration_id

    RETURN

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk