{"id":698,"date":"2014-08-25T15:25:09","date_gmt":"2014-08-25T22:25:09","guid":{"rendered":"http:\/\/www.sqldbpros.com\/?p=698"},"modified":"2014-08-25T15:26:23","modified_gmt":"2014-08-25T22:26:23","slug":"ssis-export-to-utf-8-or-unix-or-how-to-set-your-code-page-to-output-a-flat-file-for-unix","status":"publish","type":"post","link":"http:\/\/sqldbpros.com\/wordpress\/2014\/08\/ssis-export-to-utf-8-or-unix-or-how-to-set-your-code-page-to-output-a-flat-file-for-unix\/","title":{"rendered":"SSIS Export To UTF-8 or UNIX (or how to set your code page to output a flat file for unix)"},"content":{"rendered":"<p>As more and more companies are moving to heterogenous environments with both windows and unix systems the life of the Microsoft SQL Server developer is becoming much more interesting. For our recent data warehouse project I was asked to create a SQL Server 2012 Integration Services (SSIS) ETL package to output a text file for consumption by another system. No problem! I can do that in my sleep! \u00a0Unfortunately, the target\u00a0system required my file to be in a UTF-8 format. Um, what? I live in happy little Windows land. No comprende! After a bit of trial and error with my friends on the unix side of the house (\"how come the hyphens are showing up as &lt;96&gt;?\") I tracked down the following stackoverflow link which tipped me off to how to get it done: \"<a href=\"http:\/\/stackoverflow.com\/questions\/5322642\/ssis-flat-file-always-ansi-never-utf-8-encoded\" target=\"_blank\">SSIS - Flat file always ANSI never UTF-8 encoded<\/a>\". Using the info in the post I ran through the following steps.<\/p>\n<p>1. Open the Data Flow Task<br \/>\n<a href=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix9.png\"><br \/>\n<\/a><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-703\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix1.png\" alt=\"ssis to unix1\" width=\"568\" height=\"421\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix1.png 568w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix1-300x222.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/p>\n<p>2. Right click on your source and select \"Show Advanced Editor\".<\/p>\n<p>3. Select Component Properties.<\/p>\n<p>4. Set AlwaysUseDefaultCodePage to \"True\".<\/p>\n<p>5. Enter \"65001\" for the Default Code Page.<\/p>\n<p>6. Click OK.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-704\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix2.png\" alt=\"ssis to unix2\" width=\"804\" height=\"754\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix2.png 804w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix2-300x281.png 300w\" sizes=\"auto, (max-width: 804px) 100vw, 804px\" \/><\/p>\n<p>7. Don't be scared just because your flat file destination now has an ugly red X on it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-705\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix3.png\" alt=\"ssis to unix3\" width=\"567\" height=\"436\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix3.png 567w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix3-300x230.png 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/p>\n<p>8.\u00a0Right click on your Flat File Connection Manager (you may have named it something different than \"Flat File Connection Manager\") and click \"Edit\".<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-706\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix4.png\" alt=\"ssis to unix4\" width=\"546\" height=\"478\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix4.png 546w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix4-300x262.png 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/p>\n<p>9. Set the Code page to 65001 (UTF-8). Note, the values in the drop down are sorted as if they are text and there are only two rows which start with \"6\" so it's easy to miss them. Also, you must have the \"unicode\" check box empty in order to select a code page.<\/p>\n<p>10. Click OK.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-707\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix5.png\" alt=\"ssis to unix5\" width=\"710\" height=\"640\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix5.png 710w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix5-300x270.png 300w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/p>\n<p>11. Oh no! There's a slightly less scary yellow triangle on the flat file destination now! Take deep breaths.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-708\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix6.png\" alt=\"ssis to unix6\" width=\"558\" height=\"386\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix6.png 558w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix6-300x207.png 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/p>\n<p>12. Right click on the flat file destination and select \"Show Advanced Editor\".<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-715\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix71.png\" alt=\"ssis to unix7\" width=\"664\" height=\"358\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix71.png 664w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix71-300x161.png 300w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><\/p>\n<p>13. Click \"Refresh\" on the Connection Managers tab.<\/p>\n<p>14. Click OK.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-710\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix8.png\" alt=\"ssis to unix8\" width=\"799\" height=\"721\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix8.png 799w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix8-300x270.png 300w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><\/p>\n<p>15. Execute your package and feel happy when the Unix guys praise your skills.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-711\" src=\"http:\/\/www.sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix9.png\" alt=\"ssis to unix9\" width=\"560\" height=\"404\" srcset=\"http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix9.png 560w, http:\/\/sqldbpros.com\/wordpress\/wp-content\/uploads\/2014\/08\/ssis-to-unix9-300x216.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As more and more companies are moving to heterogenous environments with both windows and unix systems the life of the Microsoft SQL Server developer is becoming much more interesting. For our recent data warehouse project I was asked to create a SQL Server 2012 Integration Services (SSIS) ETL package to output a text file for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,47,147,43,46,50],"tags":[20,10,9,117,48,148,149],"class_list":["post-698","post","type-post","status-publish","format-standard","hentry","category-businss-intelligence","category-etl","category-greenplum","category-microsoft-sql-server","category-sql-server-integration-services-ssis","category-visual-studio","tag-business-intelligence","tag-ms-sql","tag-sql-server","tag-sql-server-2012","tag-ssis","tag-unix","tag-utf-8"],"_links":{"self":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/comments?post=698"}],"version-history":[{"count":8,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/698\/revisions"}],"predecessor-version":[{"id":716,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/posts\/698\/revisions\/716"}],"wp:attachment":[{"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/media?parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/categories?post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sqldbpros.com\/wordpress\/wp-json\/wp\/v2\/tags?post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}