I am new with SQL Server. I have stored proc which accepts Startdate and another parameter b. This Proc runs after every 5 min to look for records of 1 month from that time. Proc is using the join with 7 different tables based on the primary
keys in them and the date parameter.
It starts timing out after every 20-30 min. Then Even if i recompile and run with default parameter of 1 month it does not work. But when I run it for time interval less than 1 month. Keeping running it again by increasing time interval and then finally
runs fine for 1 month as by default. It works fine now for 1 month time interval.
But again after 20-30 min it starts giving time out.
I hope i made you understand the problem.
From database side all the statistics are updated, no fragmentation in the tables
Please help me to optimize the Proc and Please tell me if there are some Query hints I can use.
View Complete Post