nick轩

导航

SQLServer游标使用方法

declare @BizNo varchar(30)

declare OrderID cursor for

select TruckNo from FT_Truck where Supplier='' and OccurDate between '2010-12-03' and getdate()

open OrderID;

fetch OrderID into @BizNo;

while(@@FETCH_STATUS=0)

begin

EXEC [TF_Cala_Order_Cost_AP_SP] @ACTIONTYPE='Cala_Appl_Quotation_AP',@BizNo=@BizNo

 

fetch OrderID into @BizNo;

end

close OrderID;

deallocate OrderID;

posted on 2011-01-27 19:08  nick轩  阅读(210)  评论(0编辑  收藏  举报