Large datasets to match up

You can use a table variable. The scope of the table variable is different from that of a temp table. Table variable goes out of scope when the batch terminates. So whether or not that will work in your case is dependent on whether you are running the query that generates the 300 Ids in the same batch as where you will be consuming those.

If you want to know all the gory details about how table variables differ from temp tables, see Martin Smith's response here.