![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In my sp, i create several cursor, Now the sP go some errors, and I need to drop the cursor, Any command can let drop all the cursor ?? thx -- . |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Thanks Louis, Here the following is my code , ( i need to select the 1st table , put them into cursor and then insert into another table), but I find there is an another error (Time out expired) select Rvd.docno,Rvd.cocode,sum(Rvd.fdebit-rvd.fcredit) as paidinvamt ,sum(Rvd.debit-rvd.credit) as paidbaseamt into CursorSettleTable_rv from DTS_Account.dbo.rvdetail rvd, DTS_Account.dbo.rvheader RvH where rvd.voucherno = rvh.voucherno and rvh.validsw = 1 and rvh.transdate = @settledate and rvd.cocode in (select cocode from DTS_Master.dbo.tmp_acctcompany where reportid = @reportid) group by rvd.docno ,rvd.cocode select Pvd.docno,Pvd.cocode,sum(Pvd.fdebit-pvd.fcredit) as paidinvamt ,sum(Pvd.debit-pvd.credit) as paidbaseamt into CursorSettleTable_pv from DTS_Account.dbo.Pvdetail Pvd, DTS_Account.dbo.Pvheader PvH where Pvd.voucherno = Pvh.voucherno and Pvh.validsw = 1 and Pvh.transdate = @settledate and pvd.cocode in (select cocode from DTS_Master.dbo.tmp_acctcompany where reportid = @reportid) group by pvd.docno ,pvd.cocode insert into DTS_Account.dbo.tmp_csrvpv (docno,cocode,paidinvamt,paidbaseamt,reportid) select docno,cocode,paidinvamt,paidbaseamt,@reportid as reportid from CursorSettleTable_rv insert into DTS_Account.dbo.tmp_csrvpv (docno,cocode,paidinvamt,paidbaseamt,reportid) select docno,cocode,paidinvamt,paidbaseamt,@reportid as reportid from CursorSettleTable_pv drop table CursorSettleTable_rv drop table CursorSettleTable_pv |
![]() |
| Thread Tools | |
| Display Modes | |
| |