´æ´¢¹ý³Ì·ÖÒ³£¬Ê¹Óô洢¹ý³ÌʵÏÖ·ÖÒ³´òÓ¡

ʹÓô洢¹ý³ÌʵÏÖ·ÖÒ³´òÓ¡ - Ó¦ÓÃÈí¼þ - µçÄԽ̳ÌÍø

ʹÓô洢¹ý³ÌʵÏÖ·ÖÒ³´òÓ¡

ÈÕÆÚ£º2006-05-19   ¼ö£º

ʹÓô洢¹ý³ÌʵÏÖ·ÖÒ³´òÓ¡¡£

Õâ¸ö´æ´¢¹ý³ÌÊÇÒ»¸öСÇø¿í´øÓû§¹ÜÀíϵͳ,ÏîÄ¿Àï´úÂëµÄÒ»²¿·Ö¡£

¹¦ÄÜÊÇ£ºÊµÏְѱíuserinfoÀïµÄÓû§×ÊÁÏ°´IPÍø¶ÎÅÅÐò½øÐзÖÒ³´òÓ¡£¡£¡±ÈÈç172.20.128.XXµÄIP¼ò³ÆΪ128Íø¶ÎµÄÓû§£¬172.20.119.XXµÄIP¼ò³ÆΪ119Íø¶ÎµÄÓû§£¬

ÿ¸öÍø¶ÎµÄÓû§´òÓ¡ÔÚÒ»ÕÅA4Ö½ÉÏ£¬²»×ãÒ»Õŵİ´Ò»ÕÅ´òÓ¡£¬ÆäÓàµÄ¿É¿Õ³ö¡£´óÓÚÒ»ÕÅСÓÚÁ½Õŵİ´¶þÕÅ´òÓ¡,ÆäÓà¿Õ³ö.¾­¹ý¹ÀËãÒ»Ò³×î¶àÖ»ÄÜ´òÓ¡37ÐÐ.˼·ÊÇ:ÏÈ°Ñselect³öµÄ°´IP·Ö×éµÄÓû§ÐÅÏ¢ºÍ¼ÆËã³öµÄ¿Õ¸ñÐÐinsert½øÒ»¸öÁÙʱ±íÖÐÈ»ºó¶à´ËÁÙʱ±í´òÓ¡¾ÍÐÐÁË¡£

--Ê×ÏÈÇå¿Õ±í--truncate table subip

declare @result intdeclare @subip varchar(20)declare cur_e scroll cursor for select substring(ip_address,8,3) from userinfo group by substring(ip_address,8,3)

open cur_e--´ò¿ªÓαê--print 'aaa' convert(char(13),@@cursor_rows) fetch first from cur_e into @subip

while(@@fetch_status=0) begin --insert into subip (supip)values (@subip) insert into subip select userinfo.username,userinfo.catalyst_port,userinfo.home_address,userinfo.ip_address,userinfo.phone,catalyst.label,' from userinfo,catalyst where userinfo.catalyst_id=catalyst.id and substring(userinfo.ip_address,8,3) =@subip set @result=@@rowcount if(@result>37) begin while(@result<74) begin insert into subip select

username=',catalyst_port=',home_address=',ip_address=',phone=',label=',account=' set @result=@result 1 end end else begin while (@result<37) begin insert into subip select

username=',catalyst_port=',home_address=',ip_address=',phone=',label=',account=' set @result=@result 1 end end --select @@rowcount fetch next from cur_e into @subip endclose cur_edeallocate cur_e

±êÇ©£º