Is there a more efficient way of doing the following SQL?
I want to select the top 50 results, but I also want to set a variable to tell me if I would have gotten more results back without the TOP
DECLARE @MoreExists BIT
SET @MoreExists = 0
DECLARE @Count INT
SELECT @Count = Count(*)
FROM MyTable WHERE ... --some expensive where clause
IF @Count > 50
SET @MoreExists = 1
SELECT TOP 50 Field1, Field2, ...
FROM MyTable WHERE ... --same expensive where clause