Comments
3 comments
-
-
If the backup completed and you experienced a "Timeout expired" condition, it may be because of the ADO CommandTimeout value. Did it timeout after 30 seconds, because that appears to be the default value? Try setting it to 0 to wait until the backup completes, or a larger value that should be more than adequate for the backup to complete e.g.myConn.CommandTimeout = 900 '15 minutes
-
Thanks guys, that was it. The scripts works now. Much obliged!
Add comment
Please sign in to leave a comment.
Note that running the commandline version of SQLBackup 5.1 on the large database works fine, it's only the stored procedure version that is causing me grief.
Here is the script I am using:
' VBS script to backup up an SQLServer 2000 DB to a file share using Red-Gate's SQLBackup's stored procedure via ADO
' 20070618 dac
Option Explicit
Dim myConn
Dim mySQLCmdText
' Initialise connection object
set myConn=CreateObject("ADODB.Connection")
' Open connection to SQL server
myConn.Open="Provider=SQLOLEDB;Data Source=DB-SERVER;Initial Catalog=master;Trusted_Connection=Yes;"
' Load command to run stored procedure
mySQLCmdText= "exec master..sqlbackup N'-SQL ""BACKUP DATABASE [BigDB] TO DISK = [\\DB-SERVER\SQLBackup\BigDB-20070622.sqb] WITH INIT, COMPRESSION = 1""'"
' Execute the command
myConn.Execute mySQLCmdText
' Close connection
myConn.close
' That's All Folks!
Any ideas?
Cheers
David Cook
Technical Services Manager
Latrobe Health Services