I have a temp table with a result set of IDs. I need to disable all the records from the main table that match the ID values within my result set.
Which of the following statements is more efficient?
UPDATE MyTable
SET Disabled = 1
WHERE ID in (SELECT ID FROM @TempTable)
OR
UPDATE T
SET T.Disabled = 1
FROM MyTable as T
JOIN @TempTable as Temp
ON T.ID = Temp.ID
Other minor question: Does Row count of the temp table effect this choice?
update ID is indexed on both MyTable, and @TempTable. I guess my question is "What factors should I think about when deciding between these two different techniques for the same outcome?"