如何复制具有不同结构但相同字段的两个表?

编程入门 行业动态 更新时间:2024-10-10 17:25:06
本文介绍了如何复制具有不同结构但相同字段的两个表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在不同位置有两个SQL Server数据库,我想做类似复制的事情. 这是我的情况: 在第一个数据库中,我有一个具有以下结构的表:

I have two SQL server databases in different locations.I want to do something like replication. this is my scenario: In the first data base I have a table with following structure:

tbl_worker _Name nvarchar(10) family nvarchar(20) State int city int

在第二个数据库中,我有下表:

and in second data base I have following table:

tbl_employee _Name nvarchar(20) family nvarchar(15) Address nvarchar(30) Tell nvarchar(14) State int city int

如您所见,我在两个不同数据库中的表结构是不同的. 但我只想复制State and city字段. 如果必须更改在第一个数据库中更改的第一个数据库中的state and city,反之亦然. 我该怎么做?我可以复制吗?

as you see the structure of my tables in two different data bases are not the same. but I want to replicate just State and city fields. if the state and city in the first data base changed in second data base must be changed and vice versa. How can I do it? Can I do it with replication and how?

推荐答案

定义文章时,必须将@vertical_partition参数设置为true,然后使用sp_articlecolumn添加所需的列.

When you define the article, you'll have to set the @vertical_partition parameter to true and then add the columns that you want with sp_articlecolumn.

更多推荐

如何复制具有不同结构但相同字段的两个表?

本文发布于:2023-11-29 04:26:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1645272.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字段   两个   结构

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!