我一个极度简单的问题,问题虽然简单,但又极别重要。所以放高分!
Update P
Set P.fldComPanys=T.fldComPanys,
P.fldDeliveryPlaceS=T.fldDeliveryPlaceS,
P.fldWarehouseS=T.fldWarehouseS
From svr_Master_Po P, #Tmp_Po T
Where P.fldPoNos=T.fldPoNos
And P.fldVendorCodes=T.fldVendorCodes
Select @PayMent=isnull(fldpaymentdays,'')+isnull(fldpaymentterms,'')+isnull(fldpaymentchannels,'')+isnull(fldpaymentremarks,'')
From svr_Master_Vendor
Where fldVendorCodeS=@Vendor
Update P
Set P.fldComPanys=T.fldComPanys,
P.fldDeliveryPlaceS=T.fldDeliveryPlaceS,
P.fldWarehouseS=T.fldWarehouseS
From svr_PR_POQty P, #Tmp_Po T
Where P.fldPoNos=T.fldPoNos
假如要更新上面两个表,那事务应该怎样加呢?
如果这样可以吗?
SET XACT_ABORT ON
Begin Tran
......
......
Commit Tran
这样做,会不会锁住表?
如果要用Rollback Tran,应该怎样用呢?