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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -