0
我有一個存儲過程來得到我想要的數據:我可以使用ROWLOCK,UPDLOCK鎖定連接sql語句中的記錄嗎?
SELECT a.SONum, a.Seq1, a.SptNum, a.Qty1, a.SalUniPriP, a.PayNum, a.InvNum,
a.BLNum, c.ETD, c.ShpNum, f.IssBan
FROM OrdD a JOIN OrdH b ON a.SONum = b.SONum
LEFT JOIN Invh c ON a.InvNum = c.InvNum
LEFT JOIN cus d ON b.CusCod = d.CusCod
LEFT JOIN BL e ON a.BLNum = e.BLNum
LEFT JOIN PayMasH f ON f.PayNum = a.PayNum
LEFT JOIN Shipment g ON g.ShpNum = c.ShpNum
WHERE b.CusCod IN (SELECT CusCod FROM UsrInc WHERE [email protected] and [email protected]) AND d.CusGrp = @CusGrp
後,我得到這些記錄到光標,我使用ROWLOCK,UPDLOCK鎖定所有相關的發票號碼。 SELECT INVNUM FROM Invh WITH(ROWLOCK,UPDLOCK)WHERE INVNUM =
我可以發出鎖在桌子上INVH在一點上,我使用我的存儲過程join命令的幾個表中選擇表?
任何建議,請!
我有2個問題。你爲什麼使用遊標?你正在使用哪種RDBMS? – IamIC 2011-01-05 21:01:04