zoukankan      html  css  js  c++  java
  • ms sql server 游标

    很简单的一个小例子。

    /****** Object:  StoredProcedure [dbo].[usp_test]    Script Date: 10/28/2016 15:08:31 ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER ON
    GO
    create procedure [dbo].[usp_test]
        
    as
    declare @sRYBM varchar(20),@sJGBM varchar(20)
    
    declare sCursor cursor for select rybm,jgbm from  sys_czry --for xml path('')---操作人员表
    open sCursor
    
    fetch next from sCursor into @sRYBM,@sJGBM
    
     While(@@Fetch_Status = 0)
     begin
        print @sRYBM+' '+@sJGBM
        fetch next from sCursor into @sRYBM,@sJGBM
     end
    close sCursor
    Deallocate sCursor
    
    GO
  • 相关阅读:
    然乌湖
    邦达 八宿
    芒康
    巴塘
    禾尼乡 所波大叔
    世界高城 理塘
    相克宗 藏民家
    骑行川藏--新都桥&塔公草原
    d 3
    D2
  • 原文地址:https://www.cnblogs.com/hoaprox/p/6008199.html
Copyright © 2011-2022 走看看