Check for Table Records By EXISTS() versus COUNT()
When just checking to see if a table, temp table or table variable has any records in it, the EXISTS() function offers better performance than a straight COUNT() function and provides the same result.
For example,
IF EXISTS(SELECT * FROM Events)
PRINT 'yes'
ELSE
PRINT 'no'
END IF
The use of EXISTS() in the above query is more efficient that using a COUNT() function.
IF (SELECT COUNT(*) FROM Events) > 0
PRINT 'yes'
ELSE
PRINT 'no'
END IF