Click here to Skip to main content
15,896,727 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to work out a windows service that can backup database autoly at the specified time . Who can help me ?
Posted

Here are couple of articles on having database backup using code/utility.
Just create a service (with whatever time configuration you want) and use the codebase present in them as your base (modify as per your need!).
SQL Server backup utility[^]
SQL Server Database Backup Utility using VB.NET and SQL-DMO (New version)[^]
 
Share this answer
 
Comments
LbSoftware 18-May-10 22:29pm    
That's all about VB.Net .... Thank you very much .
Write a Windows Service and do the following things:
1] Connect to database.
2] Create a SQL script for backing up the database.
3] Use a timer and in its Elapsed event, write code to execute the script.

:)
 
Share this answer
 
v2
This can be done pretty easily just using a PowerShell script and using the Windows Scheduler to run the script every night (or week or whatever you want).

The script and documentation on how to set it up is all here: http://www.devio.at/index.php/automssqlbackup[^]

It does daily (differential) and weekly (full) backups, sends email notifications, and optionally zips the backup files if you want. That's what I use to back up all my databases every night, I haven't had any problems with it yet. Since it's just a script file, it's easy to add enhancements if you need anything additional (like adding SMTP credentials if needed)...

- Dave
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900