我有一个存储过程来获取我想要的数据:
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 UseID=@UserID and UseLev=@UserLvl)
AND d.CusGrp = @CusGrp
将这些记录放入光标后,我曾经ROWLOCK, UPDLOCK
锁定所有相关的发票编号。
SELECT InvNum FROM Invh WITH (ROWLOCK,UPDLOCK) WHERE InvNum =
我可以INVH
在存储过程中使用 join 命令从几个表中选择表时锁定表吗?
任何建议,请!