Home > Database > Mysql Tutorial > 备份还原数据库

备份还原数据库

WBOY
Release: 2016-06-07 15:17:12
Original
1075 people have browsed it

创建存储过程 CREATE PROCEDURE protest ( @var1 int, @var2 int, @var3 int output ) AS set @var3=@var1+@var2+@var3 return @var3 GO 运用存储过程 declare @var1 int set @var1='1' declare @var2 int set @var2='2' declare @var3 int set @var3='3' ex

创建存储过程
CREATE PROCEDURE protest
(
 @var1 int,
 @var2 int,
 @var3 int output
)
AS
 set @var3=@var1+@var2+@var3
 return @var3
GO

运用存储过程
declare @var1 int
 set @var1='1'
declare @var2 int
 set @var2='2'
declare @var3 int
 set @var3='3'
exec protest @var1,@var2,@var3 output
select @var3

备份数据库
backup database pubs
 to disk='c:/test/pubs.bak'

还原数据库
restore database test
 from disk='c:/test/pubs.bak'
 with move 'pubs' to 'c:/test/test.mdf',
 move 'pubs_log' to 'c:/test/test.ldf' 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template