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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -