备份数据库 还原数据库

create proc [dbo].[backupdb]
as
begin
declare @str varchar(1000);
set @str = 'backup database runewcarsbd to disk =''D:\CarManage\db\'+convert(varchar(8),getdate(),112)+'runewcarsbd.bak'''
exec (@str)
end

--还原数据库

resotre database dbname

from disk = ''

posted @ 2011-05-13 17:47  乐上  阅读(177)  评论(0编辑  收藏  举报