stored procedures - Will using a conditional variable negate execution plan retention and reuse -


i want write stored procedure in sql server utilizes "conditional variables". conditional, referring along these lines:

create procedure [dbo].[order_sel]     @begindate datetime = null     , @enddate = null = null  begin     select         id         , customerid         , dateordered             orders             (         @begindate null         or         dateordered between @begindate , @enddate         ) end 

now, know 1 of benefits of using stored procedures execution plan retention , reuse. methodology used above negate advantage?


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -