SQL Server Performance

SELECT TOP 1 1

Discussion in 'T-SQL Performance Tuning for Developers' started by pssousa, Aug 11, 2006.

  1. ArunVasu New Member

    #1 SELECT TOP 1 1 FROM Table WHERE Number='XXX'
    in this query if Number XXX found in TABLE its return 1 otherwise this query not return anything..
    but

    #2 SELECT TOP 1 Number FROM Table WHERE Number='XXX'
    in this query if number XXX found in database then return Number Field

    The above two query are same. But Both are return Different Result.
    First Query Return IF Found 1 CHAR
    Second Query Return IF Found MultiChar

    so Based on this First Query is Efficient.
  2. FrankKalis Moderator

    You have noticed that this thread is from 2006, haven't you?

Share This Page