当前位置:文档之家› 跨数据库复制数据及表结构

跨数据库复制数据及表结构

//复制表结构及数据(条件目标表不存在)
use [bucghr_debug]
select *
into bucg_hr_zyzg
from [bucghr].DBO.bucg_hr_zyzg
select * from dbo.bucg_hr_zyzg

drop table v_personlist
--drop view v_personlist
注bucghr_debugdebug为目标数据库

//复制数据
use [bucghr_debug]
insert
--into sys_qx_employee()
select
from [bucghr].DBO.sys_qx_employee
select name from Syscolumns where id=object_id('sys_qx_employee')


//复制表结构
select * into [bucghr_debug].DBO.sys_qx_deptEmployee from [bucghr].DBO.sys_qx_deptEmployee where 1=2 ;

相关主题
文本预览
相关文档 最新文档