Chinaunix
标题:
求助:在游标中使用动态生成的SQL语句
[打印本页]
作者:
catching
时间:
2003-07-11 09:33
提示:
作者被禁止或删除 内容自动屏蔽
作者:
zhuzhichao
时间:
2003-07-11 10:05
declare @cSql varchar(1000)
set @cSql = \'declare cur cursor for \' + char(13)
set @cSql = @cSql + \' select * from b_person\'
exec(@cSql)
open cur
fetch cur into ......
while @@fetch_status = 0
begin
......
fetch cur into ......
end
close cur
deallocate cur
复制代码
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2