如何自动备份数据库 [英] How to put automatic backup of database

查看:90
本文介绍了如何自动备份数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我真的需要你的帮助!



我在保存方面有些麻烦在我的系统中的数据,这已经发生了大约4次。我的问题是,每次用户在检查后保存一个病人的文件时,所有患者记录的所有预览数据都被输入的新数据替换。有没有办法每1或2小时备份所有数据,以便我可以检索预览记录,我已经有了每日备份。

提前谢谢!



这是保存数据的代码:



Hi guys,

I really need your help!

Im having some trouble in saving data in my system, this was happened about 4 times already. My problem is that every time the user save the files of one patient after the check-up all the previews data of all patient's record was being replaced by the new data inputted. Is there a way to backup all the data every 1 or 2 hours so I can retrieve the previews record, I already have the daily backup.
Thanks in advance!

here is my code in saving data:

SQL = "Insert into tbl_Main (Employee_ID, Employee_Name, Age, Sex, Division_Name, Department_Name, Section_Name, Position_Description, Appointment, CheckupDate, Findings, Recommendation, Illness, Status)" & _
 "VALUES ('" + Me.lblEmpID.Text.Trim + "', '" + Me.lblEmpName.Text.Trim + "', " + Me.lblAge.Text.Trim + ", " & _
    " '" + Me.lblSex.Text.Trim + "', '" + Me.lblDivision.Text.Trim + "', '" + Me.lblDepartment.Text.Trim + "', " & _
    " '" + Me.lblSection.Text.Trim + "', '" + Me.lblPosition.Text.Trim + "', '" + Me.lblAppointment.Text.Trim + "', " & _
    " '" + Me.dtCheckup.Text.Trim + "', '" + Me.cmbFindings.Text.Trim + "', '" & Me.txtRecommendations.Text.ToString & "', '" & Me.txtIllness.Text.ToString & "', 1)"

推荐答案

您可以创建批处理文件并使用Windows Scheduler来执行此操作

通过@EduardoMolteni在StackOverflow中的以下链接中检查答案

SQL Server自动备份 [ ^ ]

如果您需要窗口中的日程安排任务帮助,请查看以下链接

使用Windows任务计划程序运行批处理文件 [ ^ ]



希望,这有助于:)
You can create a batch file and make use of Windows Scheduler to do this
Check the answer by @EduardoMolteni in the following link in StackOverflow
SQL Server Automated Backups[^]
Check following link if you need assistance with scheduling task in windows
Run a batch file with Windows task scheduler[^]

Hope, that helps :)


这篇关于如何自动备份数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆