I'm running SQL Server (2012) on a Hyper-V instance. It has plenty of resources and 25% reserved of the total resources, the VHD is placed on a very fast SSD drive for quick response times.
Every now and then when the applications that use the SQL Server haven't been accessed for a while they get the error "The wait operation timed out". When reloading or retrying to access the database it seems to have been "waken up" and is as fast as ever.
Is there any way to ensure that this soft sleep mode doesn't occur on this kind of environment?
Added
Exception Details: System.ComponentModel.Win32Exception: The wait operation timed out
Try to execute this command:
It, incredibly, resolved the problem.
The code above its the error before the command has been executed.
I had the same issue. Running
exec sp_updatestats
did work sometimes, but not always. I decided to use theNOLOCK
statement in my queries to speed up the queries. Just addNOLOCK
after your FROM clause, e.g.:Read the full article here.
I had the exact same problem and I found that it was caused by not enough memory allocation on the Hyper-V VM. I had memory set to dynamic but it was not scaling up as required - switching to a fixed amount of memory, in my case 32GB, solved the problem. The interaction between SqlBulkCopy and Sql Server does not seem able to get more memory when required??