The following will avoid having to deal with a long WHERE IN clause as it will dump everything into #Temp and use it after to get the final SQL select command with all the fields that are needed.
This example includes a sample example of collecting 9 keys. But, in real life, this would be a bunch of conditions to determine which keys I need to collect.
SELECT Country.Numero INTO #Temp FROM Country WHERE Numero<10
SELECT Country.Title_E,Country.Title_F FROM Country WHERE Numero IN (SELECT * FROM #Temp)
The example shown above is just to demonstrate the approach. In real life, we have some very complicated SQL select commands but could use the same approach so to only collect the primary keys at first and then a simple select to get the rest of the fields.
Is this pretty much a considered optimized approach to handle that situation?