set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[Crepair]
on [dbo].[OutcomesData]
after insert
as 
...
if @id3 is not null
begin
    ...    if @id4 is not null
    begin --有 begin
        ....
    -- 没 end
    else
    begin
        ...
    end 
end