I have a SQL Table and I would like to select multiple rows by ID. For example I would like to get the row with IDs 1, 5 and 9 from my table.
I have been doing this
I guess if you joined your table with a memory table indexed by a primary key, such as:
declare @tbl table (ids int primary key)
you could fill this table with the id's you need, and preform an optimized inner join.
The problem could be the time it would take to fill it. I guess you could either have a linked server for that, or maybe use BCP utility to fill a temporary table this and then delete it.