从数据库备份时出错?从数据库备份? [英] error in backup from database? backup from database?

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

问题描述

要使用此代码备份和还原数据库


want backup and restore database with this code


string cmd = @"BACKUP DATABASE [" + Application.StartupPath + @"\KANOON.MDF]<br />
                  TO  DISK = N''"+filename +"''";



但是以相同的路径(例如Desktop con)无法获得备份?请帮我吗?



but in same path such as Desktop con not get backup? please help me?

推荐答案

^ ],则应该能够在语句的TO DISK部分中指向确切的位置(路径).

Picking up the example from here[^], you should be able to point to the exact location (path) in the TO DISK section of the statement.

USE AdventureWorks2008R2;
GO
BACKUP DATABASE AdventureWorks2008R2
TO DISK = 'Z:\SQLServerBackups\AdventureWorks2008R2.Bak'
   WITH FORMAT,
      MEDIANAME = 'Z_SQLServerBackups',
      NAME = 'Full Backup of AdventureWorks2008R2';
GO



看起来是文件名中的路径不正确,或者您没有适当的权限.



Looks like either the path in filename is incorrect, or you may not have the appropriate permissions.


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

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