动态sql创建游标(sql server数据库)

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6


[url]http://blog.sina.com.cn/s/blog_561ef93d010001yt.html[/url]

/*********************************************/
--动态sql生成游标的示例 sql server数据库
/*********************************************/
Declare @mysql nvarchar(100)
Declare @mysql2 nvarchar(100)
declare @index bigint
SET @mysql = 'select Indx from bss_order'
set @mysql2 = ' declare cur_test cursor for ' + @mysql
exec(@mysql2)
open cur_test
fetch next from cur_test into @index
close cur_test
deallocate cur_test
select @index
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6