如何在表级镜像。 [英] How to Do Mirroring in Table level.

查看:116
本文介绍了如何在表级镜像。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个数据库一个是HRMS0,表名'offer'Active和一个是PER1表名'历史''申请人'





任务:创建一个每15分钟运行一次的工作,在那里想要转移在tabe报价('名称',指定,部门)中所做的更改,而不是在员工代码中反映员工代码,这些代码应反映在员工代码中('名称',指定,部门)





示例

 <   pre     lang   =  sql >  
USE < pre lang = sql <小号pan class =code-keyword>> HRMS0
创建表Employee_details_test(employee_id varchar(100),Name varchar(100),Designation_code varchar(200))

插入Employee_details_test值(& amp;#39; B0001& amp;#39;,& amp;#39; Ramesh.G& amp;#39;,& amp;#39; J0001& amp;#39 ;),
(& amp;#39; B0002& amp;#39;,& amp;#39; Suresh& amp;#39;,& amp;#39; J0001& amp;# 39),(&放大器;放大器;#39; B0003&放大器;放大器;#39;,&放大器;放大器;#39; Ram.G&放大器;放大器;#39;,&放大器;放大器;#39; J0002&放大器;放大器;#39 ;),(&放大器;放大器;#39; B0004&放大器;放大器;#39;,&放大器;放大器;#39;六必居&放大器;放大器;#39;,&放大器;放大器;#39; J0005&放大器;放大器;#39;)及; lt; / pre& gt; < / pre >

使用PER1
创建表Employee_details_test1(employee_id varchar(100),Name varchar(100),Designation_code varchar(200))

插入Employee_details_test1值('B0001','Ramesh.G','J0002'),
('B0002','Sures.m','J0001' ),('B0003','Ram.G','J0002'),('B000','Biju','J0005')


现在我需要一个shedular来在SSIS包中运行以更新wat eever在Hrms 40表中发生的更改反映在perdb表中

示例如果我在HRMS40 DB中将B0001的名称更改为Ramesh.M,则shedular应自动执行更改PER1表Employee_details_test1针对B0001作为Ramesh.M

解决方案

 < ;   pre     lang  < span class =code-keyword> =  sql >  

USE < pre lang = sql > ; HRMS0

创建表Employee_details_test(employee_id varchar(100),Name varchar(100),Designation_code varchar(200))



插入Employee_details_test值(& amp;#39; B0001& amp;#39;,& amp;#39; Ramesh.G& amp;#39;,& amp;#39; J0001& amp; amp; #39;),

(& amp;#39; B0002& amp;#39;,& amp;#39; Suresh& amp;#39;,& amp;#39; ; J0001&放大器;放大器;#39),(&放大器;放大器;#39; B0003&放大器;放大器;#39;,&放大器;放大器;#39; Ram.G&放大器;放大器;#39;,&放大器;放大器;#39; J0002&放大器;放大器;#39),(&放大器;放大器;#39; B0004&放大器;放大器;#39;,&放大器;放大器;#39;六必居&放大器;放大器;#39;,&放大器;放大器;#39; J0005&放大器;放大器;#39;)& lt; / pre& gt; < / pre >



使用PER1

创建表Employee_details_test1(employee_id varchar(100),Name varchar (100),Designation_code varchar(200))



插入Employee_details_test1值('B0001','Ramesh.G','J0002'),

('B0002','Sures.m','J0001'),('B0003','Ram.G','J0002'),('B000','Biju','J0005')





现在我需要一个shedular在SSIS包中运行以更新wat eever Hrms 40表中发生的变化反映在perdb表中



例如,如果我在HRMS40 DB中将B0001的名称更改为Ramesh.M,则shedular应自动执行将PER1表Employee_details_test1更改为B0001作为Ramesh.M


I have two database one is HRMS0 , table name 'offer' Active and one is PER1 table name'History' 'applicant'


Task : Create a job which runs every 15 min where want to transfer the Changes made in tabe offer ('Name',designation , department) against employee code it should reflect in History table against employee code ('Name',designation , department)


example

<pre lang="sql">
USE <pre lang="sql">HRMS0
Create Table Employee_details_test (employee_id varchar(100),Name varchar(100),Designation_code varchar(200))

insert into Employee_details_test values (&amp;#39;B0001&amp;#39;,&amp;#39;Ramesh.G&amp;#39;,&amp;#39;J0001&amp;#39;),
(&amp;#39;B0002&amp;#39;,&amp;#39;Suresh&amp;#39;,&amp;#39;J0001&amp;#39;),(&amp;#39;B0003&amp;#39;,&amp;#39;Ram.G&amp;#39;,&amp;#39;J0002&amp;#39;),(&amp;#39;B0004&amp;#39;,&amp;#39;Biju&amp;#39;,&amp;#39;J0005&amp;#39;)&lt;/pre&gt;</pre>

use PER1
Create Table Employee_details_test1 (employee_id varchar(100),Name varchar(100),Designation_code varchar(200))

insert into Employee_details_test1 values ('B0001','Ramesh.G','J0002'),
('B0002','Sures.m','J0001'),('B0003','Ram.G','J0002'),('B000','Biju','J0005')


Now i need a shedular to be RUN in SSIS package to update wat eever Changes happen  in Hrms 40 table reflect in perdb table

Example if i do Changes  name for  B0001 as Ramesh.M in HRMS40 DB , the shedular should automatically do Changes PER1 table  Employee_details_test1 against B0001 as Ramesh.M

解决方案

<pre lang="sql">

USE <pre lang="sql">HRMS0

Create Table Employee_details_test (employee_id varchar(100),Name varchar(100),Designation_code varchar(200))



insert into Employee_details_test values (&amp;#39;B0001&amp;#39;,&amp;#39;Ramesh.G&amp;#39;,&amp;#39;J0001&amp;#39;),

(&amp;#39;B0002&amp;#39;,&amp;#39;Suresh&amp;#39;,&amp;#39;J0001&amp;#39;),(&amp;#39;B0003&amp;#39;,&amp;#39;Ram.G&amp;#39;,&amp;#39;J0002&amp;#39;),(&amp;#39;B0004&amp;#39;,&amp;#39;Biju&amp;#39;,&amp;#39;J0005&amp;#39;)&lt;/pre&gt;</pre>



use PER1

Create Table Employee_details_test1 (employee_id varchar(100),Name varchar(100),Designation_code varchar(200))



insert into Employee_details_test1 values ('B0001','Ramesh.G','J0002'),

('B0002','Sures.m','J0001'),('B0003','Ram.G','J0002'),('B000','Biju','J0005')





Now i need a shedular to be RUN in SSIS package to update wat eever Changes happen  in Hrms 40 table reflect in perdb table



Example if i do Changes  name for  B0001 as Ramesh.M in HRMS40 DB , the shedular should automatically do Changes PER1 table  Employee_details_test1 against B0001 as Ramesh.M


这篇关于如何在表级镜像。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆