> > Stewart
> >
> > How many records are there in cWrkOrdr and how long does it take.
> >
> > Instead of putting some conditions in the WHERE, I think you can put them in the JOIN
> > Like
> > UPDATE mrs_dtl SET tl_rtn = cWrkOrdr.rtn_qty;
> > FROM mrs_dtl;
> > INNER JOIN cWrkOrdr ON mrs_dtl.mrs_no = cWrkOrdr.mrs_no;
> > WHERE cWrkOrdr.part_code = mrs_dtl.son_code;
> > AND cWrkOrdr.prd_ordr = mrs_dtl.prd_ordr;
> > AND cWrkordr.rtn_qty > 0
> > can be
> > UPDATE mrs_dtl SET tl_rtn = cWrkOrdr.rtn_qty;
> > FROM mrs_dtl;
> > INNER JOIN cWrkOrdr ON mrs_dtl.mrs_no = cWrkOrdr.mrs_no;
> > AND cWrkOrdr.part_code = mrs_dtl.son_code;
> > AND cWrkOrdr.prd_ordr = mrs_dtl.prd_ordr;
> > WHERE cWrkordr.rtn_qty > 0
> >
> > You should have all the required indexes in place whereever you have the "=" sign.
> >
> > in mrs_dtl you need indexes on son_code, prd_ordr, mrs_no
> > in cWrkOrdr you need it on part_code, prd_ordr, mrs_no, rtn_qty
> >
> > Also you can enclose everything in a BEGIN TRANSACTION / END TRANSACTION.
> >
> > HTH
> >
> > Regards
> > Tushar
> >
> >
> Dear Expert,
>
> Can you give some example? I'm not familiar to use BEGIN TRANSACTION / END TRANSACTION.
>
> Thanks.
>
> Regards,
>
> Stewart Chew
Stewart,
In order to use transactions, you need buffering turned on. For more information on buffering, check my article here:
http://www.foxite.com/articles/read.aspx?id=75&document=moving-from-single-user-to-multiuser-in-vfpKen
You shall know the truth - and the truth shall set you free. (John 8:33)