我有sql server数据库文件(Mdf / Ldf),我想使用T-SQL命令或.net代码(C#或Vb.net)将它们转换为备份文件。
任何建议。
thans
答案 0 :(得分:3)
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...