• Thanks guys for the feedback.

    davidr (9/4/2008)


    side note: we shouldn't really be doing "select *" to check for existence. If that's a LOONNNNGGGGG row there could be a lot of overhead to no good purpose. It may be more self-documenting to code "select 'exists' from ....."

    Long time ago there was a big discussion on T-SQL forum about using SELECT * in EXIST checks.

    Despite I use always SELECT 1 (just habit) it was proven with many tests that beginning from version 2000 there is no difference what to put into SELECT.

    When it's for existence check SQL Server does not actually do the SELECT itself. Only FROM and WHERE.

    _____________
    Code for TallyGenerator