创建恢复数据库

alter procedure pro_restoredatabase(@fname varchar(1000)) as /* execute pro_restoredatabase 'd:\admin2013817-0人.bak' */ begin

--RESTORE FILELISTONLY   from disk=@fname    if db_id('YLBXTemp') is null  begin   create database  YLBXTemp  end    restore database YLBXTemp from disk=@fname with replace,  move  'YLBX' to 'd:\YLBXTemp.mdf', move 'YLBX_log'  to 'd:\YLBXTemp._log.ldf'

end

posted @ 2013-08-17 20:22  kuailewangzi1212  阅读(143)  评论(0编辑  收藏  举报