CREATE TRIGGER TR_Companies_Profiles_Delete ON companies FOR DELETE
AS
BEGIN
SET NOCOUNT ON
DELETE FROM profiles WHERE profiles.companyID in(SELECT companyID FROM deleted)
END
Trådstart#1
Tjena... ...det e jag igen.
Jag har ju inge vidare kolla på vad motsvarande tabeller "deleted" och "inserted" heter i SQL 7.0
Vad skall ändras?
GO
CREATE TRIGGER TR_Companies_Profiles_Delete ON companies FOR DELETE
AS
BEGIN
SET NOCOUNT ON
DELETE FROM profiles WHERE profiles.companyID =(SELECT companyID FROM deleted.companyID)
END
Felet: "Server: Msg 208, Level 16, State 1, Procedure TR_Companies_Profiles_Delete, Line 6
Invalid object name 'deleted.companyID'."