• I'd say that the first thing you should try is some query optimisation - maybe you can get the query running fast enough so that you don't need to do this.

    Otherwise, I'd consider creating a physical table which has the query's structure and then building a stored proc which truncates/rebuilds this table using your query. Then you can call this stored proc as part of your Agent job & then use the table in what comes next ...

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.