我很难理解这段代码在做什么。有人可以帮助我逐行理解这段代码,以便我能够理解它在做什么。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