Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBScript for SQL Database Backup...

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60017
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript for SQL Database Backup...
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 VBScript for SQL Database Backup... - 5/8/2008 9:52:21 PM   
  marconi

 

Posts: 8
Score: 0
Joined: 5/7/2008
Status: offline
Original message moved by TNO
Reason :
Hi,

I have 1 maintenance Database Server and 3 Job Servers. I want to take a Backup of SQL Database and restore it on all the
3 Job Servers.

I have the following VBScript. But the script is failing with the message "backup failed with message..."


---------------------------------------------------------------------------------------------------------------------------------------------
Option Explicit
Dim server
Dim backup
Set server = CreateObject("Microsoft.SQLServer.Management.SMO.Server")
Set backup = CreateObject("Microsoft.SQLServer.Management.SMO.Backup")
backup.Action = 0
backup.Database = "test_old"
backup.SqlBackup(server)
------------------------------------------------------------------------------------------------------------------------------------------------

Request you to please let me know the corrections in my script or a new script to achieve my purpose.

Thanks a lot in advance.

Best Regards,
KiranKumar K.
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript for SQL Database Backup... Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts