请不要把我的贴转到其他的地方去,谢谢
请问怎样在c#里面实现数据库备份
语句已经在下面了,其中kxpeople是数据库名
请哪位高手看看怎样实现
USE kxpeople
EXEC sp_addumpdevice 'disk', 'kxpeople_1', 'C:\Documents and Settings\All Users\Desktop\kxpeople1.dat'
BACKUP DATABASE kxpeople TO kxpeople_1
请不要把我的贴转到其他的地方去,谢谢
请问怎样在c#里面实现数据库备份
语句已经在下面了,其中kxpeople是数据库名
请哪位高手看看怎样实现
USE kxpeople
EXEC sp_addumpdevice 'disk', 'kxpeople_1', 'C:\Documents and Settings\All Users\Desktop\kxpeople1.dat'
BACKUP DATABASE kxpeople TO kxpeople_1
create proc 存储过程名
USE kxpeople
EXEC sp_addumpdevice 'disk', 'kxpeople_1', 'C:\Documents and Settings\All Users\Desktop\kxpeople1.dat'
BACKUP DATABASE kxpeople TO kxpeople_1
执行时候
Exec 存储过程名
直接用sql语句:
backup:
BACKUP DATABASE [YourDBName] TO DISK = N'C:\YourDBName.bak' WITH INIT , NOUNLOAD , NAME = N'YourDBName backup', SKIP , STATS = 10, NOFORMAT
restore:
RESTORE DATABASE [YourDBName] FROM DISK = N'C:\YourDBName.bak' WITH FILE = 1, NOUNLOAD , STATS = 10, RECOVERY , REPLACE