[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 874
  • Last Modified:

SQL Server Large Database Backup Error

SQL Server Large Database Backup Error

I have a large MS SQL Server 2000 database which its size is about 300MB.
I have written a C# .NET 2005 code for creating a backup of it,  but I receive a "Timeout expired" exception.

I change the Connection Timeout property of the SqlConnection object, but I still receive the same error.

It takes a long time and Hard Disk activity , but no file is created.

But, when I use Microsoft Query Analyzer to execute the BACKUP DATABASE SQL Command, it works with no error(s).

aslan maloom nist che margeshe, Timeout am ke ziad mikoni baz engar na engar !

akhe masalan 3-4 minute am tool mikeshe, hard gher gher mikone, vali filesh create nemishe !

Any solution ?
Thank you,
  • 2
2 Solutions
The best way I would suggest is to create a job for the backup and run it at a schedule time. this works fine without any problems.


Vitor MontalvãoMSSQL Senior EngineerCommented:
300MB it's a small database.
What's the connection timeout value? You can set it to 0 (zero) so you won't be disconnected by timeout.
You want to set the CommandTimeout, not the connection.
ConnectionTimeout is the to time to wait while trying to establish a connection.  You're not having trouble with that, you're problem is the command takes a long time to complete.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now