Declare @A Int=10000Declare @Cnt int=0While @A<=99999Beginif @A=REVERSE(@A)BeginSet @Cnt=@Cnt+1Print @AEndSet @A=@A+1Endselect @Cnt