Home Forums SQL Server 2005 T-SQL (SS2K5) EXISTS Subqueries: SELECT 1 vs. SELECT * (Database Weekly 11.02.2008) RE: EXISTS Subqueries: SELECT 1 vs. SELECT * (Database Weekly 11.02.2008)

  • Yep, Gail's article conclusion tells that it doesn't matter what you type between SELECT and FROM in EXISTS query, as long it represents valid T-SQL sytax, SQL server always does exactly the same thing.

    I will not be surprised if SQL query engine (parser or compiler) strips all things typed there and replaces it with some litteral constant (most likely "SELECT *") before performing the query.

    So far, all suggestions that one sytax performs better than another are just unproved speculations...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]