6

我有 2 个问题:

1) 我有一个 DT_NTEXT 列,我从数据库中提取其值并尝试将其输入 Excel 中的 Test 列。我在两者之间使用数据转换步骤将其转换为 DT_TEXT(unicode 文本版本)。

不过,最后,Excel 连接管理器正在写入零行(它显示截断警告,但执行时没有错误)。我什至通过以下步骤在数据流中添加了一个数据查看器:

"在将 Source 任务连接到 Data Conversion 和 Data Conversion 到 Destination 任务的箭头中,双击,您将打开 Data Flow Path Editor。单击 Data Viewer,然后单击 Add 并单击 OK。这将允许您查看正在通过管道。

不过,当我运行我的包时,我没有看到任何区别。

2) 我是否可以将 DT_NTEXT 列转换为 DT_WTSR 列。在一个完美的场景中,我应该将此列放入我的 Excel 中的标准 nvarchar 列中。

4

1 回答 1

1

尝试使用 DataType LongText。将 Excel 目标放置在数据流表面上后,将源连接到目标。单击新建作为 Excel 工作表的名称。让系统决定数据类型,看看是否能解决您的问题。

这就是我所做的帮助我得出这个结论的原因:

  1. 创建表

    CREATE TABLE [dbo].[ntext]
    (
        [ID] [int] NULL,
        [NTEXT] [ntext] NULL
    ) ON [PRIMARY]
    
  2. 插入一些记录

    1   asdsadsad
    2   qweqerrq
    3   But now, looping through the 351 flat-files to load the voter history records for the State's cities and towns, the package may process a few files, or up to 20 at a pop, before failing. I've been executing the packages interactively.  This is the text from the Output window from the last run:
    4    jus/juice, kilogramme/kilogram, lampe/lamp, mére/mother, nuit/night, océan/ocean, pantalon/pants, quintuplé/
    5   مباشر‎ - استمع مباشرة إلى راديو بي بي ...‎ - أخبار الشرق الاوسط‎ -
    6        Do not know what it says... just copied from some arabic web page from BBC site
    
  3. 使用 DFT 创建测试包。

    OleDB Source = 您创建的表

    Excel Dest = 创建新的 OLEDB 连接管理器

    数据访问模式 = 表或视图

    Excel 工作表的名称... 选择新建...

于 2013-02-07T21:31:38.567 回答