devicelimit = 0 CREATE TRIGGER tg_users_delete ON users FOR DELETE AS BEGIN DELETE FROM user_user WHERE managedUserId IN (SELECT deleted.id FROM deleted) END