[英]how to convert Mdf/ldf database files to .bak file (db restore) using T-SQL or .net code
I have sql server database files (Mdf/Ldf) and i want to convert them to backup file using T-SQL commands or .net Code (C# or Vb.net). 我有sql server数据库文件(Mdf / Ldf),我想使用T-SQL命令或.net代码(C#或Vb.net)将它们转换为备份文件。
any suggestions. 有什么建议么。
thans thans
BACKUP DATABASE [NameOfDatabase] TO DISK = N'D:\path\filename.bak'
WITH NOFORMAT, NOINIT, NAME = N'NameOfDatabase-Full Database Backup',
SKIP, NOREWIND, NOUNLOAD, STATS = 10
Replace NameOfDatabase with name of your database.
Replace D:\path\filename.bak with place you want to backup with
Replace Name = N database name for cosmetic indexing reasons...
Original source - http://forums.asp.net/p/1448416/3870094.aspx 原始来源 - http://forums.asp.net/p/1448416/3870094.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.