0
如何爲MS SQL Server編寫this觸發器?從MySql刪除觸發器到Sql Server後翻譯
MySQL版本:
CREATE TRIGGER log_patron_delete AFTER DELETE on patrons
FOR EACH ROW
BEGIN
DELETE FROM patron_info
WHERE patron_info.pid = old.id;
END
SQL Server版本:
CREATE TRIGGER log_patron_delete ON patrons AFTER DELETE
AS
BEGIN
DELETE FROM patron_info WHERE patron_info.pid = old.id;
END
問題:old.id
作品MySQL,但是沒有MS SQL Server的
如何刪除級聯? –
我同意juergen d - 這不是觸發器的工作,它是外鍵約束的工作。 –