当前位置: 代码迷 >> SQL >> sqlserver的备份与复原
  详细解决方案

sqlserver的备份与复原

热度:81   发布时间:2016-05-05 11:36:58.0
sqlserver的备份与还原
/*创建一个数据库wcc*/
create database wcc
go
 
/*将数据库wcc备份到c盘*/
backup database wcc
from disk = 'c:\wcc.bak'
 
backup database wcc
to disk = 'c:\wcc_diff.bak'
with differential
go
 
 
select * into wcc.dbo.xxx
from sys.objects
 
delete top (1) from wcc.dbo.xxx
go
 
 
 
restore database wcc
from disk = 'c:\wcc.bak'
with replace,norecovery

/*从c盘中将wcc数据库还原*/
restore database wcc
from disk = 'c:\wcc_diff.bak'
with recovery
  相关解决方案