all groups > sql server (alternate) > march 2006 >
You're in the

sql server (alternate)

group:

Timeout expired


Timeout expired pb648174
3/14/2006 7:09:39 AM
sql server (alternate):
After executing osql from the command line via the Windows scheduled
task interface, the following error is returned: "Timeout expired"

The code in the sql is as follows:

BACKUP Database DBName to DISK='D:\Files\Backups\DBName.bak' WITH INIT
go

Is the timeout happening during the backup or in just connecting to the
server? There is no firewall between the two machines they are on the
same hub, and the machine executing osql has SQL 2000 installed while
the database machine has SQL 2005.

Any ideas?
Re: Timeout expired Erland Sommarskog
3/14/2006 10:57:09 PM
pb648174 (google@webpaul.net) writes:
[quoted text, click to view]

Exactly how the command line for OSQL look like?

It sounds like it includes the -t option, which specifies a maximum
execution time for queries. By the default, OSQL does not time out,
which is why suspect that -t is there.

Notice that this timeout is a client-side thing. What happens when the
timeout elapses is that that the client cancels the query.

By the way, why don't you run backups from SQL Server Agent?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
Re: Timeout expired pb648174
3/15/2006 12:59:31 PM
osql -b -n -E -S ServerName -i Backup.sql


We use a single backup server that not only connects to all the various
databases and backs them up, but also copies the .bak files to another
drive, copies application files to a backup area, zips them up, etc.

I think this is related to another issue I see on some client's servers
where the web server intermittently cannot talk to the SQL server..
This error also happens intermittently. I have never figured out what
the issue is so I ping the newgroup every now and then hoping someone
will have seen it themselves. My guess is that it is network related.
Re: Timeout expired pb648174
3/15/2006 2:45:18 PM
No, but I'll put a batch file command to print the time before and
after that and see what it is the next time it happens
Re: Timeout expired Erland Sommarskog
3/15/2006 10:36:56 PM
pb648174 (google@webpaul.net) writes:
[quoted text, click to view]

If the error message is exactly "Timeout expired" and nothing else to
go with it, it looks very much like a query timeout. But should not get
one with that command line, unless there is some undocumented environment
variable that affects the query timeout.

Do you have any idea how time it take before the timeout elapses?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button