在SSIS导入期间如何处理唯一标识符值 [英] how to handle unique identifier values during SSIS import

查看:145
本文介绍了在SSIS导入期间如何处理唯一标识符值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将具有唯一标识符列的excel文件导入SQL Server,但是SSIS给我带来了很多麻烦.

I'm trying to to import an excel file with a unique identifier column into SQL server but SSIS is giving me a lot of trouble.

我可以从excel中将唯一标识符值获取到OLE DB Destination组件中,但无法将其获取到SQL Server表中.

I can get the unique identifier values from excel into the OLE DB Destination component but i can't get them into SQL Server table.

我在尝试插入唯一标识符时收到以下错误消息.

I get the error message below on trying to insert the unique identifier.

注意:在目标SQL Server表中,CreatedBy列的类型为uniqueidentifier.

NOTE: column CreatedBy is of type uniqueidentifier in the destination SQL server table.

OLE DB Destination.Inputs [OLE DB目标输入] .OLEDB Destination.Inputs [OLEDB目标输入]上的列[CreatedBy]发生错误.返回的列状态为:由于潜在的数据丢失,无法转换该值."

There was an error with OLE DB Destination.Inputs[OLE DB Destination Input].Columns[CreatedBy] on OLE DB Destination.Inputs[OLE DB Destination Input]. The column status returned was: "The value could not be converted because of a potential loss of data.".

推荐答案

我建议您尝试以下操作:

I recommend you try this:

(DT_GUID)("{"+(DT_WSTR,36)[CreatedBy]+"}")

因为您的初始字符串不包含任何方括号,所以在转换为GUID之前需要添加它们.

because your initial string doesn't contain any brackets you need to add them before converting to GUID.

玩得开心!

这篇关于在SSIS导入期间如何处理唯一标识符值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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