Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Timeout problem in SQL Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-26 : 08:30:55
Lasse writes "Hello !

I have a problem concerning SQL Server.

When I try to backup a database larger than 400 MB I get "Connection timed out". I've tried to set the timeout value to 600 (cn.ConnectionTimeout = 600) but it doesn't help.

The code goes like this:

cn.Execute "BACKUP DATABASE " & Dbname & " TO " & Dbname & "_backup"

If I try on a database size 200 Mb it works fine.

Any suggestions ?

Thanks in advance !

Lasse"

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-01-26 : 10:39:07
This may be better off in Developer forum but anyway...

suggestion 1. Make the backup part of a Sql Job. Either scheduled or launched from your code.

msdb.dbo.sp_start_job returns immediately with success or failure of whether the job was started.

suggestion 2. At least in ado.net sql client objects there is also a Command timeout property for the command object. You may be timing out from that rather than your connection object's timeout property. As an aside, you can fake out the command and the connection timeout properties by having your commandText issue 2 result sets. If the first result set returns within the timeout period then the timeout properties are satisfied and will wait indefinately. I don't recommend doing this but it's interesting.
Go to Top of Page
   

- Advertisement -