SQL Server timeout when restoring databases using SMO

I have a .NET application where I restore several databases using SMO. The timeout value in the connection string is set to 0 (no limit). Most databases are restored perfectly, with the exception of one database, which sometimes does not work during recovery. Its size is approaching 3 GB. Are there any workarounds for this problem? Are there any settings that I am missing. I am using a DatabaseRestore object to restore a database. Thank!

+3
source share
1 answer

Two timeouts are set for SMO: one - ConnectionTimeOut settings, and the other - StatementTimeOut parameter - you need to make sure that you are setting the correct one: http://social.msdn.microsoft.com/Forums/en-US/sqldisasterrecovery/thread/ b4000547-7a48-4bda-9a68-ac646259e7d2 /

This is another issue with a specific problem that solved their problem: The SMO ConnectionContext.StatementTimeout parameter is ignored

Hope this helps ...

In addition, there is a poweshell script that "supposedly" works well for large databases. http://devio.wordpress.com/category/automssqlbackup/

+3
source

All Articles