我很難理解這段代碼在做什麼。有人可以幫助我逐行理解這段代碼,以便我能夠理解它在做什麼。SQL語句。需要幫助瞭解它
CREATE TRIGGER LowCredit ON Order
AFTER INSERT
AS
DECLARE @creditrating tinyint
SELECT @creditrating = v.CreditRating
FROM Customer c INNER JOIN inserted i
ON c.custID = i.custID
IF @creditrating = 5
BEGIN
RAISERROR ('This customers''s credit rating
is too low to accept new orders.’)
ROLLBACK TRANSACTION
END
-1根據我的問題在我的答案。即使你是正確的,代碼也是錯誤的。 – gbn 2011-06-02 07:27:22
他並沒有要求我找到一個錯誤,他要求解釋代碼。 – Nix 2011-06-02 12:09:23