【问题标题】:SMO Transfer Class to transfer table with none default schemaSMO 转移类到没有默认模式的转移表
【发布时间】:2024-01-16 17:12:01
【问题描述】:

在 SSIS 中,我使用的是博客中的代码.. Blog to use SMO Transfer class

我只想传输两个表,每个表都有不同的架构..

dbo.table1

ctl.table2

dbo.table1 被转移。

ctl.table2 出现错误。

错误是Value cannot be Null

我检查了 Transfer.Options 属性,但没有真正找到任何有用的东西。

我也尝试设置Transfer.CopyAllSchemas = True,但这也无济于事。

提前致谢,

【问题讨论】:

    标签: sql-server ssis sql-server-2012 smo


    【解决方案1】:

    在传输类中找到了用于传输具有ctl 架构而不是dbo 的对象的方法。

    对于特定的架构,我们需要使用 ..

    xfr.ObjectList.Add(db.Tables("Table2", "Ctl"))
    

    这将传输`ctl.Table2。

    【讨论】: