I am in a situation where I need to run multiple times the same queries. I have to look if one of the rows returned correspond to a specific value (query 1) otherwise, I have to return the first row of the result set (query 2). In SQL Server 2008, I am wondering what is best: running the query and storing the results in a table variable or re-running the query twice (i.e. SELECT * FROM Bla WHERE Bla.Column IN (...) and SELECT TOP 1 * FROM Bla)?
Which of the two solution is preferable and/or faster?