>create table #Output (Numero, [Date] datetime) > >insert into ... > >OUTPUT Inserted.Numero, Inserted.[Date] into #Output (Numero, [Date]) >select .... > >Update Version Set FK = O.Numero >from Version INNER JOIN #Output O on Version.[Date] >= O.[Date] and Version.[Date] < dateadd(day,1, O.[Date])Thanks, I will consider this approach for upcoming requests like that. I do not know if it is easier to understand however and SQL ANSI.