When I modify the data directly in the table with an update trigger, there will be an error "[07000] The executeUpdate method must not return a result set.", but there is no such error when running UPDATE Lab5.SaleOrderDetail SET Quantity = 3 WHERE OrderID = 7 AND ProductID = 74;
in the query console, and the trigger works well.
The [07000]error
The DDL of that table is
CREATE TABLE Lab5.SaleOrderDetail
(
OrderID int NOT NULL
CONSTRAINT SaleOrderDetail_SaleOrder_OrderID_fk
REFERENCES Lab5.SaleOrder,
ProductID int NOT NULL,
Quantity int,
UnitPrice int,
PRIMARY KEY NONCLUSTERED (OrderID, ProductID)
)
GO
The trigger is (I try to set coconut on, but the problem is still there)
CREATE TRIGGER ChangeLastModified
ON lab5.SaleOrderDetail
AFTER UPDATE
AS
BEGIN
SET NOCOUNT ON;
UPDATE Lab5.SaleOrder
SET LastModified = CURRENT_TIMESTAMP
FROM lab5.SaleOrder
INNER JOIN inserted i ON SaleOrder.OrderID = i.OrderID
END
The tables in the schema By the way, why is the trigger not listed in the list on the left