We have the following scenario:
create table User {Id bigint, UserName nvarchar(50), GroupId bigint};
create table Group {Id bigint, GroupName nvarchar(50)};
create view UserView as
SELECT u.Id, u.UserName, g.GroupName
from User u
inner join Group g on u.GroupId = g.Id
Now I would like to create one trigger in the view, which runs if the User table or / is updated, and if the group table is updated.
Is it possible to use T-SQL somehow?
Using INSTEAD OF triggers does not work, because they are triggered only when the updates are directly executed.
Thank.
source
share