用于集成 MSSQL 和 MySql 数据库的 SSIS 包创建

发布于 2024-10-12 03:42:05 字数 654 浏览 6 评论 0原文

我正在尝试创建一个 SSIS 包来集成 MSSQL 和 MYSQL。我之前没有使用 Bid 或 SSIS 的经验,也没有按照 此处

我将 OLE DB 源、查找、条件拆分、OLE DB 目标和 OLE DB 命令组件添加到数据流,并将连接管理器和列映射配置到条件拆分组件。

从这里开始,我面临两个问题 -

1)配置 OLE DB 目标后,它在组件上显示错误符号,表示无法在 unicode 和非 unicode 字符串数据类型之间转换。为了解决这个问题,我尝试在条件拆分和目标之间插入一个数据转换组件,并将其配置为有问题的列。但这似乎没有帮助

2) 在配置 OLE DB 命令时,“列映射”选项卡中的右侧列显示零列。我添加了带有问号的 Sql 命令,所以我想如果我没记错的话,它应该显示名为“Param_0”、“Param_1”等的列。我什至尝试从输入和输出属性选项卡手动添加它们,但随后它显示警告,OLE DB 命令的外部列与数据源不同步

我在这里缺少什么?

谢谢

I am trying to create an SSIS package for integrating between MSSQL and MYSQL. I have no prior experience of working with Bids or SSIS and following the instructions from here.

I added the OLE DB Source, Lookup, Conditional Split, OLE DB Destination and OLE DB Command components to the Data Flow and configured the connection managers and column mappings upto the Conditional Split component.

From here, I am facing two problems -

1) After configuring the OLE DB Destination, it shows error symbol on the component that says could not convert between unicode and non unicode string datatypes. To solve this, I tried to insert a Data Conversion Component between the Conditional Split and the Destination and configured it for the problematic column. But that doesnt seem to help

2) While configuring the OLE DB Command, the right hand side column in Column mappings tab shows zero columns. I have added the Sql command with question marks so i guess it should be showing columns named "Param_0", "Param_1" etc if i am not wrong. I even tried to add them manually from the input and output properties tab but then it shows the warning, external columns for OLE DB command are out of sync with data source

What am I missing here ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

漫雪独思 2024-10-19 03:42:05

从您描述第一个问题的方式来看,它听起来应该可行。这里有一些需要检查的事情。

  1. 数据转换组件为转换后的数据创建一个新列。确保您在以下转换和目标中引用它。
  2. 右键单击数据转换组件并选择高级编辑器。在高级编辑器中选择输入和输出属性选项卡。展开树视图的数据转换输出分支并选择新列。确保数据类型属性也显示您想要转换的数据类型。如果这些值不正确,则组件中的设置有问题。

对于第二个问题,该问题通常是由 SqlCommand 值错误引起的。首先,确保“连接管理器”选项卡上的“连接管理器”正确。切换到列映射选项卡。在表单底部附近,可能会出现一条警告消息,指示无法准备 SQL 语句。换句话说,SSIS 无法弄清楚该语句应该做什么。解决 SQL 语句的任何问题并切换回“列映射”选项卡。一旦可以解析 SQL 语句,这些列就会出现。

The way you describe your first problem, it sounds like it should work. Here are a couple of things to check.

  1. The data conversion component creates a new column for the converted data. Make sure you are referring to it in your following transformations and destination.
  2. Right-click on the Data Conversion component and select Advanced Editor. Select the Input and Output Properties tab in the Advanced Editor. Expand the Data Conversion Output branch of the tree-view and select your new column. Ensure that the Data Type Properties show the data type that you want to convert too. If these values are not right then something is not right with the setup in the component.

For your second problem, the issue can frequently be caused by an error with the SqlCommand value. First, make sure the Connection Manager is correct on the Connection Manager tab. Switch to the Column Mappings tab. Near the bottom of the form, there may be a warning message that indicates that the SQL statement cannot be prepared. In other words, SSIS can't figure out what the statement is supposed to do. Address any problems with the SQL statement and switch back to the Column Mappings tab. The columns will appear once the SQL statement can be parsed.

初见你 2024-10-19 03:42:05

如果您想避免转换问题,请将目标表列类型从 char/varchar 更改为 nchar/nvarchar。我很确定您需要对 mysql 源和目标使用 ADO 连接器,您应该能够从 mysql 源读取数据并写入 mssql 数据库,而无需使用源和目标组件以外的任何组件。

If you want to avoid the conversion issues then change your destination table column types from char/varchar to nchar/nvarchar. I'm pretty sure you will need to use an ADO connector for mysql source and destinations, you should be able to read data from the mysql source and write to the mssql database w/o using anything other than source and destination components.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文