简体   繁体   English

如何进行数据库备份

[英]How to take the database backup

Using SQL Server 2000 使用SQL Server 2000

I want to take the database backup at application running time. 我想在应用程序运行时进行数据库备份。

In my application i have database backup option, when i click the button it has to take the database backup upto current time. 在我的应用程序中,我具有数据库备份选项,当我单击按钮时,它必须将数据库备份更新到当前时间。

How to make a query for taking the database backup 如何进行数据库备份查询

Need Query Help 需要查询帮助

use BACKUP DATABASE statement, for example: 使用BACKUP DATABASE语句,例如:

BACKUP DATABASE myDatabase -- myDatabase is your database name
TO DISK='d:\backup\myDatabase.bak' -- this is the path to backup

Personally, I recommend todo backup for price. 就个人而言,我建议您以价格做备份。 it offers comprehensiv backup solution for SQL server/ Exchange server. 它为SQL Server / Exchange Server提供了全面的备份解决方案。 for more information, you can go its website . 有关更多信息,请访问其网站

通常,像BACKUP DATABASE databasename这样的语句可以解决问题,但是请检查Sql Server帮助以获取有关所有选项和参数(例如备份位置,模式,压缩等)的信息。

Also, you can choose what type of backup (full, differential, log) you need to perform with the "Backup database..." command. 另外,您可以使用“ Backup database ...”命令选择需要执行的备份类型(完整,差异,日志)。

Examples: 例子:

Full backup: 完整备份:

BACKUP DATABASE "database_name" TO DISK = 'D:\\backupDatabase-Full.bak' GO BACKUP DATABASE“ database_name” TO DISK ='D:\\ backupDatabase-Full.bak'GO

Differential backup: 差异备份:

BACKUP DATABASE "database_name" TO DISK = 'D:\\backupDatabase-Diff.bak' WITH DIFFERENTIAL GO BACKUP DATABASE“ database_name” TO DISK ='D:\\ backupDatabase-Diff.bak',带有差异GO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM