• This is not something I had ever heard of:

    Paul White (4/28/2009)


    Though the example given may not result in a good plan either, because SQL Server cannot sniff the local variable parameters.

    Are you saying that the following statement would result in a better query plan? (or more reliably result in a good query plan?)

    SELECT *

    FROM SomeTable

    WHERE (SomeColumn >= '2009-04-01' AND SomeColumn = '2009-04-01' AND SomeColumn < DateAdd(Day, 1, '2009-04-15') )

    Is there any reference to this issue / mechanism anywhere online that I can look at?

    http://poorsql.com for T-SQL formatting: free as in speech, free as in beer, free to run in SSMS or on your version control server - free however you want it.