• This is what I use to do that same thing. It is used in a SSIS package and the results are held in an object variable then I loop through that variable executing an update stats command.

    select o.object_id,o.name,s.stats_id,s.name

    from sys.objects o

    inner join sys.stats s on o.object_id = s.object_id

    where o.type = 'U'

    and stats_date(o.object_id,s.stats_id) <= getdate()-20

    order by o.object_id,s.stats_id