shunliy

在oracle中备份一张表可以用

create table 表的备份名称

as

select * from 需要备份的表名 

但是在sql server 中这些写却不可以。需要用insert into * B from A 这样的sql语句来执行表的备份。

这种备份的原则是表B不存在。

 

如下所示:

use 数据库名

go

 

if exists (select name from sysobjects where name=\'表的备份名称\' and type=\'u\')

drop table 表的备份名称

go

 

begin

  select * into 表的备份名称 from 需要备份的表名 

end

go

分类:

技术点:

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2021-06-01
  • 2021-12-06
  • 2021-12-06
  • 2021-09-12
  • 2021-06-22
猜你喜欢
  • 2021-12-06
  • 2021-11-15
  • 2021-09-22
  • 2021-10-24
  • 2021-12-16
  • 2021-12-06
  • 2021-12-16
相关资源
相似解决方案