I’m giving a webinar on SQL Server Stored Procedures Thursday morning (March 12th) at 1 PM Eastern time. This 70-minute session discusses how to write efficient stored procedures and call them from ADO.NET.
The materials and précis can be downloaded from here… http://www.pbconferences.com/8Y/9W

Hello, I was in the demo today about optimizing stored procs and had a question about the procedure you used for an example. It appeared your proc would filter rows based one or more parms that were passed in. My questions is what was the magic in the where clause that allowed this to only filter by the parms that were populated?
The only "magic" was that I tested each Parameter passed for a NULL value after having set the default value of the Parameter in the SP definition to NULL. This way, if the application does not pass the named parameter its value is assigned to NULL.
hth