Translate

Saturday, 17 November 2018

generate next number

DECLARE @MAXID INT
SELECT  @MAXID=ID_MAX FROM SDMIS_STUDENT_MASTER_18_19_Mapping_with_dist WHERE Dist_code='2105'
UPDATE SDMIS_STUDENT_MASTER_18_19_SUNDERGARH_2105
 SET @MAXID = ID = @MAXID+1 
where ID is null and assesment_status='N' AND TC_Status IS NULL;

 

DECLARE @MAXXXX INT
SELECT @MAXXXX =MAX(ID) FROM SDMIS_STUDENT_MASTER_18_19_SUNDERGARH_2105
WHERE  assesment_status='N' AND TC_Status IS NULL;
--PRINT @MAXXXX
UPDATE SDMIS_STUDENT_MASTER_18_19_Mapping_with_dist SET ID_MAX=@MAXXXX
WHERE Dist_code='2105'

No comments:

Post a Comment