SPR_StudentRegisterUpdateTaskReset

For sharing any stored procedures
Post Reply
User avatar
robinwilson16
Site Admin
Posts: 185
Joined: Sun Oct 16, 2016 6:46 pm
Forename: Robin
Surname: Wilson
College Name: FEA
Position: MIS Consultant
LinkedIn Profile: https://www.linkedin.com/in/robinwilson16

SPR_StudentRegisterUpdateTaskReset

Post by robinwilson16 » Fri Mar 03, 2017 12:05 am

Used in conjunction with the Student Register Update task schedule on the server to flood fill tilde and W marks. The stored procedure resets any registers that failed to update so they will be processed the next time the task runs

Code: Select all

CREATE PROCEDURE [dbo].[SPR_StudentRegisterUpdateTaskReset]
AS

BEGIN
	SET NOCOUNT ON;

	UPDATE ST
	SET
		ST.st_end = NULL,
		ST.st_status = NULL,
		ST.st_errormessage = NULL
	FROM ulive.dbo.caps_systemtask ST
	INNER JOIN ulive.dbo.capd_moduleenrolment MEG
		ON MEG.e_id = ST.st_object
	INNER JOIN ulive.dbo.capd_module GRP
		ON GRP.m_id = MEG.e_module
	INNER JOIN ulive.dbo.capd_session SES
		ON CAST ( SES.s_start AS DATE ) <= CAST ( GETDATE() AS DATE )
		AND CAST ( SES.s_end AS DATE ) >= CAST ( GETDATE() AS DATE )
	WHERE
		GRP.m_type = 'G'
		AND GRP.m_start <= LEFT ( SES.s_name, 2 ) + RIGHT ( SES.s_name, 2 ) + '-07-31'
		AND GRP.m_end >= LEFT ( SES.s_name, 4 ) + '-08-01'​​
		AND ST.st_type = 'attenrol'
		AND ST.st_status = 'failed'
END

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests