alter PROCEDURE SP_InsertUpdateSchoolSession ( @Sessionid int, @Schoolid int, @Session nvarchar(50), @Sessionstrtdte nvarchar(50), @Sessionenddte nvarchar(50), @flag int --@Status int output ) AS BEGIN if(@flag=1) begin if not exists (select 'X' from CreateSchSessions where CONVERT(nvarchar(50), GETDATE(),103)>=SessionEnddate and SchoolId=@Schoolid and Status=1) begin insert into CreateSchSessions(SchoolId,Session,SessionStartDte,SessionEnddate,Status) values (@Schoolid,@Session,@Sessionstrtdte,@Sessionenddte,1) select 'success' msg end else begin select 'duplicate' msg end end if(@flag=2) begin -- update select 'update' msg end if(@flag=3) begin ---update select 'delete' msg end end
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)