迁移具有不同数据类型的 Excel 工作表

发布于 2024-08-09 07:51:24 字数 396 浏览 0 评论 0原文

我正在使用 ssis 迁移具有不同数据类型的 Excel 工作表,

但数据格式在源级别本身正在发生变化

我的 Excel 工作表如下所示:

COL1

Null 2009年1月1日 无效的 2009年1月2日 11.99 123.99

当我在源预览中看到它本身时,我看到像

COL1

Null 这样的数据 2009 年 1 月 1 日 12:00:00 上午 无效的 2009 年 1 月 2 日 12:00:00 上午 1899 年 12 月 30 日 12:00:00 上午 12/30/1899 12:00:00 AM

我觉得需要在提供给 Excel 的连接字符串中进行一些设置,以维护每个单元格的相应格式。 如果有任何想法请建议我

I am migrating the excel sheet which has different data types using ssis

But data format is changing in source level itself

My excel sheet looks like below:

COL1

Null
1/1/2009
Null
1/2/2009
11.99
123.99

When i see in the source preview it self i am seeing data like

COL1

Null
1/1/2009 12:00:00 AM
Null
1/2/2009 12:00:00 AM
12/30/1899 12:00:00 AM
12/30/1899 12:00:00 AM

i feel there need to be some setting in the the connection string given to the excel for maintaining the respective formats of each cell.
Please suggest me if there are any ideas

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

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

发布评论

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

评论(1

始于初秋 2024-08-16 07:51:24

您是否了解过“数据转换”数据流转换组件可以为您提供什么?

我在将数据从数据库传输到电子表格时遇到了相关问题。数字类型作为文本类型插入(即使在添加转换组件之后)。经过大量阅读后,似乎在复制到 Excel 时,该过程默认为每列的上述单元格的数据类型。

解决这个问题的唯一方法(听起来确实有点垃圾)是在目标电子表格中在数据插入位置的正上方有一个隐藏的数据行。该行的每个单元格中的数据应包含与列中的数据类型相同的值。

试一试

Have you had a look at the what the "Data Conversion" Data Flow Transformation component can offer you?

I had a related issue in transferring data from a database to a spreadsheet. Number types were getting inserted as text types (even after adding a conversion component). It appeared that, after quite a bit of reading, that when copying to excel, the process defaulted to the data type of the above cell of each column.

The only away around this (and it does sound a bit rubbish) is to have a hidden row of data in your destination spreadsheet immediately above where your data will be inserted. The data in each cell of this row should contain a value that is of the type that data in column should be.

Give it a shot

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