SSIS 2008 中的主从迁移
我有两个 MSSQL 2008 数据库 dbA 和 dbB, dbA 包含主从表对:AMaster、ADetail。对应它dbB还包含BMaster和BDetail。 A 和 B 之间唯一的区别是主键的类型。在源数据库 (dbA) 中它是整数,但在目标数据库 (dbB) 中它是唯一标识符。
亲爱的同事:如何描述SSIS中的数据流来转换这种情况?我需要转换所有字段,但将其替换为新的密钥类型。
I have two MSSQL 2008 databases dbA and dbB,
dbA contains master-detail tables pair: AMaster, ADetail. Corresponding it dbB also contains BMaster and BDetail. The only one difference betwee A and B is type of primary key. In source database (dbA) it is integer but in destination (dbB) it is uniqueidentifier.
Dear colleagues: how to describe dataflow in SSIS to convert this case? I need convert all fields, but replace it with new key type.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不想将自然主键存储在目标中,如何管理更新。就像如果源中的记录发生更改并且您想要在目标表中复制相应的更改,您将如何做到这一点,我的意思是这在逻辑上是不可能的。您要么必须在目标表中保留基于整数的自然键,要么必须保留存储旧自然键和相应的新键映射信息的映射表。
而且 UID 是一个更大的数字,我认为将整数转换为 UID 不是一个好的选择。如果你真的想做的话,就按照这个方法去做吧。 INT>>十六进制字符串>> UID。在此处查看有关 UID 的更多信息 [http://msdn.microsoft.com/en -us/library/ms187942.aspx]
If you do not want to store the natural primary key in the destination how do you mange updates. Like if a record is changed in the source and you want to replicate a corresponding change in the destination table, how will you do that, I mean this not logically possible. Either you will have to keep the integer based natural key in the destination table or you will have to keep mapping table which stores old natural key and corresponding new key mapping info.
And UID is far bigger number and I don't think that converting integer to UID is a good option. If you really want to do it, do it this way. INT >> HEX STRING >> UID. Check more on UID here [http://msdn.microsoft.com/en-us/library/ms187942.aspx]