首页 文章

如何通过SSIS包用平面文件目标文件中的空格替换列长中剩余的额外长度?

提问于
浏览
0

在SSIS中,我正在创建一个包并将数据从oledb源加载到平面文件目的地 . 在加载时,我用分号分隔符(;)分隔了列,用CR-LF分隔了行 . 我正在使用(ansi-latin 1)1252编码 .

我遇到的问题是如下 . 我有3列名称varchar(10),城市varchar(10),国家varchar(10)

我在平面文件中输出为

enter image description here

但是,我需要输出

enter image description here

如上所示,我希望在空间占据的空间中留出额外的长度 . 请有人帮助我 .

1 回答

  • 0

    解决方案可能是:在“平面文件”连接管理器的“格式”选项卡中,选择“固定宽度”或“向右调整”

    enter image description here

    Here对差异的解释 .

    在“高级”选项卡上,添加3列,每列10个 .

    低于出口的结果

    enter image description here

    but in this case you can not enter the column separators ';' in the file;
    a workaround: insert you the separator in the export QUERY (OLE DB Source Editor - SQL Command Text) so they are interpreted as a column of width 1, so you have exactly what you need

    我希望这有帮助 .

相关问题