SQL Server does optimize non-sproc queries pretty well. Contrary to what most people think, they are even faster in a number of cases because the server is often able to create a better execution plan depending on the parameters, as opposed to sprocs that
have a fixed execution plan, which sometimes negates the effect of not having to compile the query.
As always when perf is involved, measurement is the only way to find out.
Hanselminutes on 9 - ASP.NET 4 and Stephen Walther on AJAX
Oct 21, 2009 at 4:47 PMWhy is Stephen entirely silent?
ASP.NET AJAX Futures
Nov 12, 2008 at 1:27 PMPolita Paulus - BLINQ
Jul 25, 2006 at 11:47 AMAs always when perf is involved, measurement is the only way to find out.