dEClaRE @CountNum INt Set QCount Num=(SELECT COUNT (*)FROM StuCou WHERE StuNO= 00000025 lf @CountNum>4 BEGIN ROLLBACK TRANSACTION PRINT’超过报名门数! END ELSE BEGIN COMMIT TRANSACTION PRINT报名成功! ENDDECLARE @CountNum INT SET @CountNum= (SELECT COUNT(*) FROM StuCou WHERE StuNo='00000025') IF @CountNum>4 BEGIN ROLLBACK TRANSACTION PRINT '超过报名门数!' END ELSE BEGIN COMMIT TRANSACTION PRINT '报名成功!' END