SqlServer 备份数据库语法 IT


DECLARE @strPath NVARCHAR(200)
set     @strPath = convert(NVARCHAR(16),getdate(),120)
set @strPath = REPLACE(@strPath'-' , '')
set @strPath = REPLACE(@strPath':' , '')
set @strPath = 'D:\XRayDB_Backup\XRay_backup_'+@strPath + '.bak'

BACKUP DATABASE [xray] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT


 备份结果:【XRay_backup_20120328 1146.bak】

原文地址:https://www.cnblogs.com/machaofast/p/2420991.html