问题描述
|
好的,这可能很简单,但是我找不到解决方案。
我开始在T-SQL中使用游标,并且正在使用它们。
但是,如果我通过Execute-Button在Management Studio中执行结果,则不会得到结果。我得到的只是“命令成功执行”。
如果我调试它,我将得到结果,下次单击执行时,我还将得到结果...
有某种缓存吗?还是我做错了?
脚本如下所示:
declare @po varchar(20),@prod varchar(50),@qty integer,@type varchar(20)
declare db_cursor cursor for
select product,po,qty,space(1) as btype from header
for read only
open db_cursor
while @@FETCH_STATUS=0
begin
fetch db_cursor into @po,@prod,@qty,@type
if @qty<1000
set @type = \'small\'
else
set @type = \'large\'
print @type
end
close db_cursor
deallocate db_cursor
PS:自然,我在印刷前用过select,同样的问题。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)