• There is a more subtle point, Im making in the query plan optimisation that is saved.

    A greater man, than I has quite nicely explained this , have a quick look at ( a google search should pull up the resource info):

    MSDN I smell a parameter. Tips, Tricks, and Advice from the SQL Server Query Optimization Team

    MSDN Ken Henderson plan stability in SQL Server 2000

    It goes into a lot more detail than I can in this forum.

    The example posted was quite cut-down, within the given example a name lookup is used to get the PK, which is then used to get the result set back. (2 Querys onto the source table - when this should really be a single set-based query utilising the name as in posters article to get the desired result-set, without the need to lookup the ID value then assign to a local var then use the local var value as a lookup )