Can anyone suggest an alternative (faster way) to setting this variable '@count';
SELECT @count = COUNT(*)
FROM VendorLargeTable
WHERE ColumnName = @Variable
AND Id = @ID
The t-sql then goes on to do something like if @count > 0 then update .....
Would there be a way to use a top somehow? Instead of going though the whole table we just want to know if there is more than 0 records meeting the condition. I would think that once 1 is found we could stop the search?
Any assistance would be greatly appreciated!