{"id":301,"date":"2013-07-24T20:31:08","date_gmt":"2013-07-24T14:31:08","guid":{"rendered":"http:\/\/markwheeler.com\/wordpress\/?p=301"},"modified":"2013-07-24T20:31:08","modified_gmt":"2013-07-24T14:31:08","slug":"ssis-transformation-for-sharepoint-list-adapter","status":"publish","type":"post","link":"https:\/\/www.markwheeler.com\/?p=301","title":{"rendered":"SSIS transformation for Sharepoint List Adapter"},"content":{"rendered":"<p>I was using the <a href=\"http:\/\/sqlsrvintegrationsrv.codeplex.com\/releases\/view\/17652\">SSIS Sharepoint List Adapter<\/a>\u00a0and ran into an issue with importing calculated columns and People columns.<a href=\"http:\/\/markwheeler.com\/wordpress\/wp-content\/uploads\/2013\/07\/SqlTask2.png\"><br \/>\n<\/a><\/p>\n<p>The import process was inserting USERID;#Username into my People column in the destination database table. It was<\/p>\n<p>also inserting datetime;#12\/12\/2013 into my date fields.<\/p>\n<p><a href=\"http:\/\/markwheeler.com\/wordpress\/wp-content\/uploads\/2013\/07\/SqlTask2.png\"><img loading=\"lazy\" decoding=\"async\" alt=\"SqlTask2\" src=\"http:\/\/markwheeler.com\/wordpress\/wp-content\/uploads\/2013\/07\/SqlTask2.png\" width=\"555\" height=\"285\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>I found a handy script component that will transform those columns on the fly.<\/p>\n<p>You have to insert the script component as a transformation between the Sharepoint List Source and your destination. You must also allow<br \/>\nall columns to pass through. The column you want to manipulate must be set to Read\/Write.<\/p>\n<p><a href=\"http:\/\/markwheeler.com\/wordpress\/wp-content\/uploads\/2013\/07\/SqlTask.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-302\" alt=\"SqlTask\" src=\"http:\/\/markwheeler.com\/wordpress\/wp-content\/uploads\/2013\/07\/SqlTask.png\" width=\"489\" height=\"64\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Paste this in the Input0_ProcessInputRow function&#8230;<\/p>\n<p>string[] delimiter = new string[] {&#8220;;#&#8221;};<br \/>\nstring[] peopleSplit = Row.PeopleField.Split(delimiter,StringSplitOptions.None);<br \/>\nstring result = string.Empty;<\/p>\n<p>for (int i = 1; i &lt; peopleSplit.Length; i += 2)<br \/>\n{<br \/>\nresult += peopleSplit[i];<br \/>\nif (i != peopleSplit.Length &#8211; 1)<br \/>\n{<br \/>\nresult += &#8220;, &#8220;;<br \/>\n}<br \/>\n}<\/p>\n<p>Row.PeopleField = result;<\/p>\n<p>Change the &#8220;PeopleField&#8221; string to your appropriate column.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was using the SSIS Sharepoint List Adapter\u00a0and ran into an issue with importing calculated columns and People columns. The import process was inserting USERID;#Username into my People column in the destination database table. It was also inserting datetime;#12\/12\/2013 into my date fields. &nbsp; I found a handy script component [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[10],"tags":[99,110],"class_list":["post-301","post","type-post","status-publish","format-standard","hentry","category-sharepoint","tag-sharepoint-2010","tag-ssis"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=301"}],"version-history":[{"count":0,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/301\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}