Click here to Skip to main content
15,888,202 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

By Saving the folder that contain database files will backup the database and is it possible to take it as current data in the database for future...?

Please give the answer for simple question which i have doubt on...


Logendran
Posted

1 solution

In SQL Server you can set a Backup Job which will create backups of your database according your settings like on every hour, every day etc.

A. Create a Schedule

1. SQL Server Agent > Right Click on Jobs > Manage Schedules
2. Click on New > Name: Backups > Schedule Type > Recurring > Select other features like Start Time, End Time, Daily or Hourly etc > OK

B. Create a Job

1. SQL Server Agent > Right Click on Jobs > New Job
2. Job Name: Backups
3. Select Steps > Click on New > Give Step Name i.e. Step1 > Select your database Name
4. In Command Area give this query >

SQL
BACKUP DATABASE MMISDB
    TO  DISK = N'C:\Test\MMISDB.bak'
WITH
    NOFORMAT,
    COMPRESSION,
    NOINIT,
    NAME = N'MMISDB-Full Database Backup',
    SKIP,
    STATS = 10;
GO


5. Select Schedules > Pick Schedule name which you have make for backup.
6. Now OK your Backup job is ready.
7. Test your job is working or not. > Right click on your Job > Start Job
8. Now you can see your backup in your specified location. After starting your job It will work automatically on specified time in schedule.

Remember: I have used C:\Test\ folder for backup you can specify another. MMISDB is my database name you can use your database name.
 
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