在c#中创建备份和还原SQL Server 2008 [英] Create Backup and Restore SQL server 2008 in c#

查看:91
本文介绍了在c#中创建备份和还原SQL Server 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#中创建备份和恢复sql server ???? b $ b当我创建备份时,备份将附加到现有备份中???



[edit] phil.o:删除虚假粗体[/ edit]

How create backup and restore sql server in c# ???
when I create backup then backup will be append in existing backup???

[edit] phil.o : removed spurious bold [/edit]

推荐答案

请看这里:用C#备份SQL数据库 [ ^ ]


备份:

MSDN - BACKUP(Transact-SQL) [ ^ ]



恢复:

MSDN - RESTORE(Transact-SQL) [ ^ ]



只需用 SqlCommand <调用这些命令br />


请注意,查询中包含的路径始终是服务器的本地路径而不是客户端。如果要从服务器的驱动器以外的任何其他位置备份或还原,则需要服务器可以访问的网络共享。
Backup:
MSDN - BACKUP (Transact-SQL)[^]

Restore:
MSDN - RESTORE (Transact-SQL)[^]

Just call those commands with an SqlCommand

Take care that the paths you include into the query are alway local to the server not to the client. If you want to backup to or restore from any other location than the drives from the server you need a network share where the server has access to.


这篇关于在c#中创建备份和还原SQL Server 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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