Change the file encoding of the file which is created using SSIS Log provider for Text Files

给你一囗甜甜゛ 提交于 2021-02-19 05:41:14

问题


I am new to SSIS, I have already designed a package and configured SSIS Log provider for Text Files. This works fine and log files are generated successfully.

We have a monitoring team, they use this log file for monitoring. They are unable to read the log files since the file encoding is in Unicode format. They are expecting a non unicode format for their monitoring.

I tried to change the existing log file encoding to ANSI but when I re-run the package my log file has been created again with UNICODE encoding.

Is any way we can create log files using SSIS Log provider for Text Files with non unicode encoding. Kindly suggest me any workaround. I am unable to find solution for the past two days.


回答1:


Trying to figure out the issue

Since SSIS Log provider for Text Files use a File connection manager for logging purposes, you don't have the choice to edit the file encoding within the SSIS package because this type of connection manager can be used for different files format (excel, text ...).

While searching for this issue it looks like if the log is created for the first time by SSIS it will write unicode data.

  • why are my log files getting generated with a space between every two characters?
  • Why is my SSIS text logfile formatted in this way?

Possible workaround

Try to create an empty text file using notepad and save it with ANSI encoding.

Then select this file from the SSIS logging configuration.

Other helpful links

  • Change the default of encoding in Notepad
  • Add Logging with SSIS

Update 1 - Experiments

To test the workaround i provided i have run the following experiments:

  1. I add SSIS Logging and created and a new log file

  1. After executing the package the file is create in Unicode (to check that i opened the file using notepad and click Save As the encoding shown in the combobox is Unicode)
  2. I create a new file using Notepad and save it using Ansi encoding as mentioned above.
  3. In SSIS i changed the File connection manager to Use Existing instead of Create New and i selected the file i created

  1. After executing the package the log is filled within the file and the encoding is still Ansi
  2. I repeated executing the package several times and the undoing wont changes.

TL DR: Create a file with ANSI encoding outside the ssis package and within the package create a file connection manager, select Use Existing option and choose the created file. Use this file connection manager for logging purposes.



来源:https://stackoverflow.com/questions/55040423/change-the-file-encoding-of-the-file-which-is-created-using-ssis-log-provider-fo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!