select @SmallestZS=Smallest_ZS from SetServerList where ServerName=@serverselect @LargestZS=Largest_ZS from SetServerList where ServerName=@server

if not (@SmallestZS is null) beginupdate character set ctlcode=(ctlcode | 0x81) where [name] not in(SELECT NAME FROM WEB_ZS WHERE (ACC = @uid) AND (ZSCS >= @LargestZS) AND (ZSCS <= @SmallestZS)) AND (AccountID = @uid)endendDELETE FROM MEMB_STAT_GJ WHERE (memb___id = @uid and servername=@server)update character set ctlcode=(ctlcode | 0x81) where [name] in(SELECT name FROM MEMB_STAT_GJ WHERE (memb___id = @uid)) AND (AccountID = @uid)