sqlserver数据库自动备份

DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '.')
set @strPath = 'E:\data_bak\' + '数据库名称'+@strPath + '.bak'
BACKUP DATABASE [数据库名称] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT

你可能感兴趣的:(sqlserver)