Result Processing Stored Procedure final version (05-12-2011)

USE [dbRegistration]
GO

/****** Object: StoredProcedure [dbo].[sp_ResultProcessing] Script Date: 12/05/2011 18:13:20 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

— =============================================
— Author: <Author: Update by: Md. Nazim Uddin>
— Create date: <Date: 14-11-2011>
— Description: <Process Results of Selected Term>
— =============================================
CREATE PROCEDURE [dbo].[sp_ResultProcessing]
(
@TermId varchar(50)
)
–exec sp_ResultProcessing ‘CSE2011MAR_2K10Y3T2′
AS
BEGIN
— Declare Variables for internal use
DECLARE
@intErrorCode int,
@CourseId varchar(20),
@TotalMarks Decimal(10,2),
@StudentId int,
@LetterGrade varchar(5),
@GradePoint Decimal(6, 2),
@RegularTerm varchar(30),
@TermType char,
@Count int,
@ProcessingDecision int

SELECT @ProcessingDecision=(SELECT TermClosingStatus FROM T_Term_Setup WHERE TermId=@TermId)

IF(@ProcessingDecision=0)
——————————————————————————————————————–
BEGIN
———————————————————————————————————————

—- Starting Transaction———
begin transaction
———————————————— Term Closing —————————————————–
——- Makeing Term Closed ——–
—15-11-2011
UPDATE T_Term_Setup
SET TermClosingStatus=1
WHERE TermId=@TermId

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

———————————————– Class Test Marks Update ————————————————–

–Update Class Test Marks
declare TermResultCursor cursor for

select distinct CourseId
from T_Term_Class_Test_Marks
where TermId = @TermId

open TermResultCursor

fetch next from TermResultCursor into
@CourseId
while @@FETCH_STATUS = 0
begin
declare ClassTestResult cursor for

SELECT StudentId, SUM(ClassTestMarks) —- make sum of 3/4 class test
FROM dbRegistration.dbo.T_Term_Class_Test_Marks
WHERE CourseId = @CourseId
GROUP BY StudentId

open ClassTestResult

fetch next from ClassTestResult into
@StudentId, @TotalMarks
while @@FETCH_STATUS = 0
begin
UPDATE T_Term_Std_Result_Theory_Details
SET ClassTest=@TotalMarks
WHERE StudentId=@StudentId AND CourseId=@CourseId AND TermId = @TermId

fetch next from ClassTestResult into
@StudentId, @TotalMarks
end
close ClassTestResult
deallocate ClassTestResult

fetch next from TermResultCursor into
@CourseId
end
close TermResultCursor
deallocate TermResultCursor

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

——————————————– Theory Related ——————————————————–

–Read RegularTerm
SELECT @TermType=TermType, @RegularTerm=isnull(RegularTermId,@TermId)
FROM T_Term_Setup
WHERE TermId=@TermId

–Read TotalMarks of Theory
SELECT @TotalMarks=TotalMarks
FROM T_Term_Marks_Distribution
WHERE TermId=@TermId AND CourseType=’Theory’

–Update %Marks of Theory
UPDATE T_Term_Std_Result_Theory_Details
SET [%Marks]=(Attendance+SectionA+SectionB+ClassTest+Grace)*100/@TotalMarks
WHERE TermId=@TermId

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

——————————————– Sessional Related ——————————————————–
–Read TotalMarks of Sessional
SELECT @TotalMarks=TotalMarks
FROM T_Term_Marks_Distribution
WHERE TermId=@TermId AND CourseType=’Sessional’

–Update %Marks of Sessional
UPDATE T_Term_Student_Result_Lab_Details
SET [%Marks]=(LabPerformance+Attendance+Viva+CenteralViva+Quiz+Grace)*100/@TotalMarks
WHERE TermId=@TermId

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

——————————————– Thesis Related ——————————————————–
–Read TotalMarks of Sessional
–SELECT @TotalMarks=TotalMarks
— FROM T_Term_Marks_Distribution
— WHERE TermId=@TermId AND CourseType=’Thesis’
–DECLARE @TotalMarks INT,
–@TermId varchar(50)
–SELECT @TermId=’CSE2011NOV_2K10Y4T1′

SELECT @TotalMarks=100

–Update PercentMarks of Sessional
UPDATE T_Term_Std_ThesisProject_Result_Details
SET PercentMarks=([4thYear1stTerm]+[VivaVoce]+[InternalExaminer]+[ExternalExaminer])*100/@TotalMarks,
TotalMarks=([4thYear1stTerm]+[VivaVoce]+[InternalExaminer]+[ExternalExaminer]),
CourseContinuityStatus=’X’
WHERE TermId=@TermId

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

———————————————- Theory Result Processing —————————————————

–Student’s Theory result with Letter grade
declare TermTheoryResultCursor cursor for

select isnull(CourseId,”),
isnull(StudentId,-1),
isnull(CEILING([%Marks]),-1)
from T_Term_Std_Result_Theory_Details
where TermId = @TermId

open TermTheoryResultCursor

fetch next from TermTheoryResultCursor into
@CourseId, @StudentId, @TotalMarks
while @@FETCH_STATUS = 0
begin
SELECT @LetterGrade=LetterGrade, @GradePoint=GPA
FROM T_Term_Marks_GPA_Setup
WHERE StartMarks<=@TotalMarks AND @TotalMarks<=EndMarks AND TermId=@TermId

–Insert into Term_Wise_Course_Result
INSERT INTO T_Term_Wise_Course_Result(TermId, RegularTerm, CourseId, StudentId, LetterGrade, GradePoint, TermType)
VALUES(@TermId, @RegularTerm, @CourseId, @StudentId, @LetterGrade, @GradePoint,@TermType)

–Insert into T_Common_Student_Earned_Credit
if(@LetterGrade<>’F’)
begin
INSERT INTO T_Common_Student_Earned_Credit(TermId, RegularTerm, CourseId, StudentId, LetterGrade, GradePoint,TermType)
VALUES(@TermId, @RegularTerm, @CourseId, @StudentId, @LetterGrade, @GradePoint,@TermType)
end

–If Failed insert or update Common_Backlog_Info
IF(@GradePoint=0)
begin
SELECT @Count=COUNT(*)
FROM T_Common_Backlog_Info
WHERE StudentId=@StudentId AND CourseId=@CourseId

IF(@Count=0)
begin
INSERT T_Common_Backlog_Info(StudentId, CourseId)
VALUES(@StudentId, @CourseId)
end
ELSE
begin
UPDATE T_Common_Backlog_Info SET RegistrationStatus=’B’ WHERE StudentId=@StudentId AND CourseId=@CourseId
end

print @Count
print ‘Separate’
end

–Delete Course From BackLog If passed…….
IF(@GradePoint>0)
begin
DELETE FROM T_Common_Backlog_Info
WHERE StudentId=@StudentId AND CourseId=@CourseId
end

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

fetch next from TermTheoryResultCursor into
@CourseId, @StudentId, @TotalMarks
end
close TermTheoryResultCursor
deallocate TermTheoryResultCursor

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

—15-11-2011
———————————————- Sessional Result Processing ———————————————————–

–Student’s Sessional result with Letter grade
declare TermSessionalResultCursor cursor for

select isnull(CourseId,”),
isnull(StudentId,-1),
isnull(CEILING([%Marks]),-1)
from T_Term_Student_Result_Lab_Details
where TermId = @TermId

open TermSessionalResultCursor

fetch next from TermSessionalResultCursor into
@CourseId, @StudentId, @TotalMarks
while @@FETCH_STATUS = 0
begin
SELECT @LetterGrade=LetterGrade, @GradePoint=GPA
FROM T_Term_Marks_GPA_Setup
WHERE StartMarks<=@TotalMarks AND @TotalMarks<=EndMarks AND TermId=@TermId

–Insert into Term_Wise_Course_Result
—TermType added 22-11-2011

INSERT INTO T_Term_Wise_Course_Result(TermId, RegularTerm, CourseId, StudentId, LetterGrade, GradePoint, TermType)
VALUES(@TermId, @RegularTerm, @CourseId, @StudentId, @LetterGrade, @GradePoint, @TermType)

–Insert into T_Common_Student_Earned_Credit
if(@LetterGrade<>’F’)
begin
INSERT INTO T_Common_Student_Earned_Credit(TermId, RegularTerm, CourseId, StudentId, LetterGrade, GradePoint,TermType)
VALUES(@TermId, @RegularTerm, @CourseId, @StudentId, @LetterGrade, @GradePoint,@TermType)
end

–If Failed insert or update Common_Backlog_Info
IF(@GradePoint=0)
begin
SELECT @Count=COUNT(*)
FROM T_Common_Backlog_Info
WHERE StudentId=@StudentId AND CourseId=@CourseId

IF(@Count=0)
begin
INSERT T_Common_Backlog_Info(StudentId, CourseId)
VALUES(@StudentId, @CourseId)
end
ELSE
begin
UPDATE T_Common_Backlog_Info SET RegistrationStatus=’B’ WHERE StudentId=@StudentId AND CourseId=@CourseId
end

print @Count
print ‘Separate’
end

–Delete Course From BackLog If passed…….
IF(@GradePoint>0)
begin
DELETE FROM T_Common_Backlog_Info
WHERE StudentId=@StudentId AND CourseId=@CourseId
end

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

fetch next from TermSessionalResultCursor into
@CourseId, @StudentId, @TotalMarks
end
close TermSessionalResultCursor
deallocate TermSessionalResultCursor

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

–04-12-2011
—————————————- Thesis Result Processing ————————————————–
–Student’s Thesis result with Letter grade
DECLARE @ThesisProcessDecision INT,
@TargetYear INT,
@TargetTerm INT

SELECT @ThesisProcessDecision = COUNT(*) FROM T_Term_Std_ThesisProject_Result_Details
WHERE TermId = @TermId

SELECT @TargetYear=TargetYear,@TargetTerm=TargetTerm FROM T_Term_Setup WHERE TermId=@TermId

if(@ThesisProcessDecision>0 AND @TargetYear=4)
begin

declare TermThesisResultCursor cursor for

select isnull(CourseId,”),
isnull(StudentId,-1),
isnull(CEILING(PercentMarks),-1)
from T_Term_Std_ThesisProject_Result_Details
where TermId = @TermId

open TermThesisResultCursor

fetch next from TermThesisResultCursor into
@CourseId, @StudentId, @TotalMarks
while @@FETCH_STATUS = 0
begin

if(@TargetTerm=2)
begin
SELECT @LetterGrade=LetterGrade, @GradePoint=GPA
FROM T_Term_Marks_GPA_Setup
WHERE StartMarks<=@TotalMarks AND @TotalMarks<=EndMarks AND TermId=@TermId
end

–Insert into Term_Wise_Course_Result
—TermType added 22-11-2011
if(@TargetTerm=1)
begin
INSERT INTO T_Term_Wise_Course_Result(TermId, RegularTerm, CourseId, StudentId, LetterGrade, TermType)
VALUES(@TermId, @RegularTerm, @CourseId, @StudentId, ‘X’, @TermType)
end
else if(@TargetTerm=2)
begin
INSERT INTO T_Term_Wise_Course_Result(TermId, RegularTerm, CourseId, StudentId, LetterGrade,GradePoint,TermType)
VALUES(@TermId, @RegularTerm, @CourseId, @StudentId, @LetterGrade,@GradePoint,@TermType)
end

–Insert into T_Common_Student_Earned_Credit
if(@LetterGrade<>’F’ AND @TargetTerm=2)
begin
INSERT INTO T_Common_Student_Earned_Credit(TermId, RegularTerm, CourseId, StudentId, LetterGrade, GradePoint,TermType)
VALUES(@TermId, @RegularTerm, @CourseId, @StudentId, @LetterGrade, @GradePoint,@TermType)

DECLARE @PrevTerm varchar(50), @PrevCourse varchar(50)

SELECT DISTINCT @PrevTerm=TermId,@PrevCourse=CourseId FROM T_Term_Std_ThesisProject_Result_Details WHERE TermId<>@TermId AND StudentId=@StudentId
AND ResultPrecessingStatus=0 AND CourseContinuityStatus=’X’

INSERT INTO T_Common_Student_Earned_Credit(TermId, RegularTerm, CourseId, StudentId, LetterGrade, GradePoint,TermType)
VALUES(@PrevTerm, @RegularTerm, @PrevCourse, @StudentId, @LetterGrade, @GradePoint,@TermType)

UPDATE T_Term_Std_ThesisProject_Result_Details
SET
ResultPrecessingStatus=1
WHERE CourseId=@PrevCourse AND TermId= @PrevTerm

UPDATE T_Term_Std_ThesisProject_Result_Details
SET CourseContinuityStatus=’X’,
ResultPrecessingStatus=1
WHERE CourseId=@CourseId AND TermId= @TermId
end

–If Failed insert or update Common_Backlog_Info
IF(@GradePoint=0)
begin
SELECT @Count=COUNT(*)
FROM T_Common_Backlog_Info
WHERE StudentId=@StudentId AND CourseId=@CourseId

IF(@Count=0)
begin
INSERT T_Common_Backlog_Info(StudentId, CourseId)
VALUES(@StudentId, @CourseId)
end
ELSE
begin
UPDATE T_Common_Backlog_Info SET RegistrationStatus=’B’ WHERE StudentId=@StudentId AND CourseId=@CourseId
end

print @Count
print ‘Separate’
end

–Delete Course From BackLog If passed…….
IF(@GradePoint>0)
begin
DELETE FROM T_Common_Backlog_Info
WHERE StudentId=@StudentId AND CourseId=@CourseId
end

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

fetch next from TermThesisResultCursor into
@CourseId, @StudentId, @TotalMarks
end
close TermThesisResultCursor
deallocate TermThesisResultCursor

end

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

—15-11-2011
———————————————————————————————————————

–Update Result Processing Status [Result Theory]
UPDATE T_Term_Std_Result_Theory_Details
SET ResultProcessingStatus=1
WHERE TermId=@TermId

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

—15-11-2011
———————————————————————————————————————
–Update Result Processing Status [Result Laboratory]
UPDATE T_Term_Student_Result_Lab_Details
SET ResultPrecessingStatus=1
WHERE TermId=@TermId

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR

— 17-11-2011
————————— Calculation of T_Student_Credit_Status TotalEarnedCredit value —————————-
DECLARE
@TotalEarnedCredit decimal(18,2),
@TotalEarnedPoint decimal(18,2),
@TestRecord int,
@StudentCategory int

declare StudentCreditStatus cursor for

select isnull(StudentId,-1)
from T_Term_Std_Course_Reg
where TermId = @TermId

open StudentCreditStatus

fetch next from StudentCreditStatus into
@StudentId
while @@FETCH_STATUS = 0
begin

SELECT @StudentCategory=COUNT(*)from T_Common_Student_Earned_Credit WHERE T_Common_Student_Earned_Credit.LetterGrade!=’F’ AND T_Common_Student_Earned_Credit.StudentId=@StudentId
if(@StudentCategory>0)
begin
UPDATE T_Student_Credit_Status
SET StudentCategory=2
WHERE StudentId=@StudentId
end

SELECT @TotalEarnedCredit=SUM(T_Common_Course_Information.CourseCredit)
FROM T_Common_Course_Information INNER JOIN
T_Common_Student_Earned_Credit ON T_Common_Course_Information.CourseId = T_Common_Student_Earned_Credit.CourseId
WHERE T_Common_Student_Earned_Credit.StudentId=@StudentId AND T_Common_Student_Earned_Credit.LetterGrade!=’F’

SELECT @TotalEarnedPoint = SUM(T_Common_Student_Earned_Credit.GradePoint * T_Common_Course_Information.CourseCredit)
FROM T_Common_Course_Information INNER JOIN
T_Common_Student_Earned_Credit ON T_Common_Course_Information.CourseId=T_Common_Student_Earned_Credit.CourseId
WHERE T_Common_Student_Earned_Credit.StudentId=@StudentId

select @TestRecord = COUNT(*) from T_Student_Credit_Status WHERE StudentId=@StudentId
if(@TestRecord>0)
begin
UPDATE T_Student_Credit_Status
SET TotalEarnedCredit=@TotalEarnedCredit,
TotalEarnedPoint=@TotalEarnedPoint
WHERE StudentId=@StudentId
end
else if(@TestRecord=0)
begin
insert into T_Student_Credit_Status(StudentId,TotalEarnedCredit,TotalEarnedPoint)
values(@StudentId,@TotalEarnedCredit,@TotalEarnedPoint)
end

fetch next from StudentCreditStatus into
@StudentId
end
close StudentCreditStatus
deallocate StudentCreditStatus

— If Any errors then go for Roll Back Transaction
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR
—————————————————————————————————————————-
–Commit Transaction if no error
commit transaction

————-User defined label for exeption handling—————
PROBLEMERROR:
IF (@intErrorCode <> 0)
BEGIN
–PRINT ‘Unexpected error occurred!’
ROLLBACK TRAN
END
——————————————————————————————————————–
END
———————————————————————————————————————

END
GO

 

REGISTRATION

USE [dbRegistration]
GO

/****** Object: StoredProcedure [dbo].[sp_preregistration_move] Script Date: 12/05/2011 12:30:52 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE proc [dbo].[sp_preregistration_move]
(
@StudentId int,
@toDay datetime
)
as
–exec sp_preregistration_move—-200207007
begin
DECLARE @intErrorCode INT,
@TermId varchar(30),
@TermIdTemp varchar(30), —16-11-2011
@CourseId varchar(20),
@RegularBacklogStatus varchar(2),
@CourseTitle varchar(50),
@CourseType varchar(20)

—- Starting Transaction———
begin transaction

–16/11/2011
————————————————– T_Student_Credit_Status ————————————————————————
DECLARE @CurrentYear INT,
@CurrentTerm INT,
@TestRecord INT,
@TermType varchar(5)

select @TermIdTemp=isnull(TermId,”) from T_Term_Std_PreCourse_Reg where StudentId = @StudentId

select @TermType=TermType from T_Term_Setup WHERE TermId = @TermIdTemp

if(@TermType=’R’)

BEGIN

select @CurrentYear=TargetYear ,@CurrentTerm=TargetTerm from T_Term_Setup WHERE TermId = @TermIdTemp
select @TestRecord = COUNT(*) from T_Student_Credit_Status WHERE StudentId=@StudentId
if(@TestRecord>0)
begin
UPDATE T_Student_Credit_Status
SET CurrentTerm=@CurrentTerm,
CurrentYear=@CurrentYear
WHERE StudentId=@StudentId
end
else if(@TestRecord=0)
begin
insert into T_Student_Credit_Status(StudentId,CurrentTerm,CurrentYear)
values(@StudentId,@CurrentTerm,@CurrentYear)
end

———–Select whether any error Occurs or not——–
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR — If Any errors then go for Roll Back Transaction

————————————————————————————————————————————————–
————————————————– T_Student_Credit_Status table field RegisteredCredit ——————————————-
DECLARE @thisTermCredit decimal(4,2)

SELECT @thisTermCredit= CAST(SUM( T_Common_Course_Information.CourseCredit)AS Decimal(4,2))
FROM T_Common_Course_Information INNER JOIN
T_Term_Std_PreCourse_Reg ON T_Common_Course_Information.CourseId = T_Term_Std_PreCourse_Reg.CourseId
WHERE StudentId=@StudentId

begin
UPDATE T_Student_Credit_Status
SET RegisteredCredit=isnull(RegisteredCredit,0)+ @thisTermCredit
WHERE StudentId=@StudentId
end

———–Select whether any error Occurs or not——–
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR — If Any errors then go for Roll Back Transaction

————————————————————————————————————————————————–
END

–T_Term_Student_Reg_Status table StudentRegistration field date update
———————————————————– T_Term_Student_Reg_Status ———————————————————–

select @TermIdTemp=isnull(TermId,”) from T_Term_Std_PreCourse_Reg where StudentId = @StudentId —16-11-2011
UPDATE T_Term_Student_Reg_Status SET StudentRegistration= @toDay WHERE StudentId=@StudentId AND TermId=@TermIdTemp —16-11-2011

———–Select whether any error Occurs or not——–
SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR — If Any errors then go for Roll Back Transaction

————————————————————————————————————————————————–

————————————————————————————————————————————————–
declare StudentRegistrationCursor cursor for

select isnull(TermId,”),
isnull(CourseId,”),
isnull(RegularBacklogStatus,”)
from T_Term_Std_PreCourse_Reg
where StudentId = @StudentId

open StudentRegistrationCursor

fetch next from StudentRegistrationCursor into
@TermId,@CourseId,@RegularBacklogStatus
while @@FETCH_STATUS = 0
begin

Insert into T_Term_Std_Course_Reg(StudentId,TermId,CourseId,RegularBacklogStatus)
values(@StudentId,@TermId,@CourseId,@RegularBacklogStatus)

SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR — If Any errors then go for Roll Back Transaction

select @CourseTitle=CourseTitle, @CourseType=CourseType
from T_Common_Course_Information
where CourseId=@CourseId

IF (@CourseType=’Theory’)
begin
Insert into T_Term_Std_Result_Theory_Details(StudentId,TermId,CourseId,CourseTitle)
values(@StudentId,@TermId,@CourseId,@CourseTitle)
end
ELSE IF (@CourseType=’Thesis’)
begin
Insert into T_Term_Std_ThesisProject_Result_Details(StudentId,TermId,CourseId)
values(@StudentId,@TermId,@CourseId)
end

ELSE IF(@CourseType<>’Theory’ AND @CourseType<>’Thesis’)
begin
Insert into T_Term_Student_Result_Lab_Details(StudentId,TermId,CourseId)
values(@StudentId,@TermId,@CourseId)
end

SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR — If Any errors then go for Roll Back Transaction

delete from T_Term_Std_PreCourse_Reg
where StudentId = @StudentId
and TermId = @TermId
and CourseId = @CourseId

SELECT @intErrorCode = @@ERROR
IF (@intErrorCode <> 0) GOTO PROBLEMERROR — If Any errors then go for Roll Back Transaction

–UPDATE T_Term_Student_Reg_Status SET StudentRegistration= @toDay WHERE StudentId=@StudentId –TermId needed

fetch next from StudentRegistrationCursor into
@TermId,@CourseId,@RegularBacklogStatus
end
close StudentRegistrationCursor
deallocate StudentRegistrationCursor

–UPDATE T_Term_Student_Reg_Status SET StudentRegistration= @toDay WHERE StudentId=@StudentId

commit transaction

PROBLEMERROR: ————-User defined label for exeption handling—————
IF (@intErrorCode <> 0)
BEGIN
–PRINT ‘Unexpected error occurred!’
ROLLBACK TRAN
END
end
GO

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s