c# - SQL Server query plan cache randomly getting corrupted -


i have asp.net site running off sql server database following nightly maintenance plan:

  1. check database integrity
  2. rebuild index
  3. update stats
  4. clean history

every , wake stream of following errors (and unhappy users!)

the conversion of varchar data type datetime data type resulted in out-of-range value.

i've figured out that's it's because 1 of sp cache plans has gone skewiff, i.e. 1 of signatures no longer correct (it's trying force varchar parameter datetime). i'm using linq 2 sql (can't change that!) results in manner of weird , wonderful sp_executesql calls. way know fix step in , execute following sql after fact:

dbcc dropcleanbuffers dbcc freeproccache 

any ideas can stop issue happening in first place?


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -