zoukankan      html  css  js  c++  java
  • 游标的使用

    SET NOCOUNT ON
    DECLARE @startip bigint
    declare @addr nvarchar(50)
    DECLARE @endip bigint
    declare @detailaddr varchar(100)
    declare @countnumber int
    declare @cid int
    set @countnumber=0
    DECLARE publish_cursor CURSOR FOR
    SELECT cast(rtrim(startip) as bigint),cast(rtrim(endip) as bigint),rtrim(addr),rtrim(detailaddr),id FROM t_ip
        OPEN publish_cursor

        FETCH NEXT FROM publish_cursor
        INTO @startip,@endip,@addr,@detailaddr,@cid

            WHILE @@FETCH_STATUS = 0
            BEGIN
            print @cid
                --修改记录
                update t_ip set ip1=@startip,ip2=@endip,addr1=@addr,addr2=@detailaddr where id=@cid
                --修改结束
                FETCH NEXT FROM publish_cursor into  @startip,@endip,@addr,@detailaddr,@cid
               
            END
        CLOSE publish_cursor
        DEALLOCATE publish_cursor
       
    GO

  • 相关阅读:
    一般处理程序页ashx 序列化 Json数组
    SQL server 分页
    MySQL 分页
    获取网站的BaseURL
    java学习书籍推荐
    查询并关闭指定端口进程
    ettercap使用
    MS10-046漏洞利用
    MS12-020漏洞利用
    入侵安卓手机
  • 原文地址:https://www.cnblogs.com/aaa6818162/p/1563054.html
Copyright © 2011-2022 走看看