I get the error invalid column media.user and tuid. Before running this i see that media.user does exist and i would think that the coalesce() as tuid would solve the tuid problem.
Why are these columns invalid?
CREATE TRIGGER media_comment_trig_0 ON media_comment AFTER INSERT AS
INSERT INTO user_incoming_media_comments(recipient, comment)
SELECT coalesce(p.author, [media.user]) as tuid, INSERTED.id
FROM media
JOIN INSERTED ON media.id = INSERTED.media
LEFT JOIN media_comment p on p.id=INSERTED.parent
WHERE tuid <> INSERTED.author;