I have one stored procedure in SQl Azure is calling periodically at 5 minutes and processing crore of data and it sometimes give Timeout error as per below as per my log.
Timeout expired. The timeout period elapsed prior to completion of
the operation or the server is not responding.
How can i increase Timeout of this query or whole Db? and what would be default Timeout?
Update
I think Time out is not due to connection to sql azure here as per answers of @Ming and @Ruchit because when i have checked the log then below error it will display message like
Warning: Null value is eliminated by an aggregate or other SET
operation.
It means query is being executed, above message because of i have used some aggregate function on NULL value. Am i thinking correct? what should be other possible cause?
Thanks in Advance.
According to http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/7070c2f9-07d1-4935-82c2-b74a196908ee/, SQL Azure will close idle connections that are longer than 5 minutes. As you mentioned you’re calling the stored procedure every 5 minutes, thus you may be on the edge of timeout. I would like to suggest you to change to every 4 minutes to see whether it works.
In addition, when using SQL Azure, retry is very important. When a query fails, please close the connection, wait for a few seconds, and then create a new connection, try the query again. Usually the second time will work fine.
Best Regards,
Ming Xu.