首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

sql2005自动备份授命

2012-09-03 
sql2005自动备份指令DECLARE @strPath NVARCHAR(200)set @strPath convert(NVARCHAR(19),getdate(),120)

sql2005自动备份指令

DECLARE @strPath NVARCHAR(200)set @strPath = convert(NVARCHAR(19),getdate(),120)+'ximeng_we'set @strPath = REPLACE(@strPath, ':' , '.')set @strPath = 'E:\data\' + @strPath + '.bak'BACKUP DATABASE [ximeng_web] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT




其中@strPath 是设置自动备份文件名和路径
[ximeng_web] 是我们要备份的数据库,BACKUP DATABASE

热点排行