用于集成 MSSQL 和 MySql 数据库的 SSIS 包创建
我正在尝试创建一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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.
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.
如果您想避免转换问题,请将目标表列类型从 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.