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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -