I see your Begin transaction but I don't see your End
transaction.
[quoted text, click to view] >-----Original Message-----
>Hi
>I am facing a problem while saving data from my
application.
>Actualy syntax showing below working fine.The problem is
that after
>retrieving this report in my application,when any other
user try to
>inserting any record into ap_spled the application is
hanging and cannot
>insert into this table.Is their any problem in my stored
proced syntax.How
>can i solve this.
>Please help.
>
>CREATE PROCEDURE test(@edate datetime,@supp_idv char
(8),@div char(2),@dept
>char(3))
>AS CREATE table #out_inv(supp_id char(8),inv_no char
(15),inv_date datetime
>NULL,dept_code char(3),dr_amt numeric(14,3),cr_amt numeric
(14,3),bal
>numeric(14,3),tr_type char(2),entry_type char(1))
>begin
>Insert into #out_inv
>select supp_id,inv_no,inv_date,dept_code,dr_amt,cr_amt,
>(select sum(cr_amt) - sum(dr_amt) from ap_spled b WHERE
a.supp_id =
>b.supp_id and
>a.inv_no = b.inv_no group by
b.inv_no),trans_type,entry_type
>from ap_spled a where division = @div AND inv_date <=
@edate and supp_id =
>@supp_idv and
>(select sum(cr_amt) - sum(dr_amt) from ap_spled b WHERE
a.supp_id =
>b.supp_id and a.inv_no = b.inv_no
>group by b.inv_no) <> 0 ;
>select
>a.supp_id,a.inv_no,a.inv_date,a.dr_amt,a.cr_amt,a.bal,a.tr
_type,a.entry_type,a.dept_code,d.name from #out_inv
a,supplier_file d
[quoted text, click to view] >where a.supp_id = d.supplier_id order by supp_id,inv_no;
>--
>Thanks
>.