灯火互联
管理员
管理员
  • 注册日期2011-07-27
  • 发帖数41778
  • QQ
  • 火币41290枚
  • 粉丝1086
  • 关注100
  • 终身成就奖
  • 最爱沙发
  • 忠实会员
  • 灌水天才奖
  • 贴图大师奖
  • 原创先锋奖
  • 特殊贡献奖
  • 宣传大使奖
  • 优秀斑竹奖
  • 社区明星
阅读:2781回复:0

[SQL Server]SQLserver局部数据备份

楼主#
更多 发布于:2012-09-04 18:04


--delete from zd_bg_zh_copy where rq between to_date('2011-11-1', 'yyyy-mm-dd') and to_date('2011-12-31', 'yyyy-mm-dd')

1.
insert into zd_bg_zh_copy
select * from zd_bg_zh where rq between to_date('2011-11-1', 'yyyy-mm-dd') and to_date('2011-12-31', 'yyyy-mm-dd')--将需要备份的数据添加到另一个表中,结构要一样才行

2.
select * into zd_bg_zh_copy from zd_bg_zh where rq between to_date('2011-11-1', 'yyyy-mm-dd') and to_date('2011-12-31', 'yyyy-mm-dd')--如果没有事先建好结构一样的表,会自动创建一个这样的表





喜欢0 评分0
游客

返回顶部