declare @objectID int;
select @objectID = object_id from sys.triggers where parent_id = object_id(N'dbo.UserInfo') and name= N'tr_VIEW_UserInfo_Delete';
declare @createOrAlter nvarchar(6);
set @createOrAlter = case when @objectID is null then N'create' else N'alter' end;
exec (@createOrAlter + N' trigger dbo.tr_VIEW_UserInfo_Delete
on dbo.UserInfo
with execute as owner
instead of delete
as
begin
    -- cascade deletes are enabled
    delete u
    from dbo.UserAccount u
        inner join deleted i on i.ID = u.ID
end;');