Craig Farrell (12/15/2010)
Actually, the WHERE 1=1 is a neat little trick to avoid doing extra if statements to determine if something starts the clause and needs an AND. Since 1=1 is always true, it never evaluates (as far as a limited testing I did showed), but saves you some complex semantics, since all statements, no matter if first or not, can start with the AND field = @_param1 structure.
I think that this should be qualified with: "when writing dynamic SQL". It is incredibly useful then; and utterly useless any other time.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes