USE IS21_xxx; if object_id('tempdb..#tmp') is not null drop table #tmp create table #tmp ( cntr ), ip ) ) insert into #tmp VALUES (','91.50.73.898') ), ), ), @sttime datetime; DECLARE CounterIp CURSOR FOR SELECT CNTR,IP FROM #TMP OPEN CounterIp fetch…