{"id":3792,"date":"2021-11-26T09:43:03","date_gmt":"2021-11-26T17:43:03","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3792"},"modified":"2021-11-26T09:43:05","modified_gmt":"2021-11-26T17:43:05","slug":"how-to-download-odata-source-to-sql-or-a-txt-file-in-ssis","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3792","title":{"rendered":"How to Download OData Source to SQL or a TXT File in SSIS"},"content":{"rendered":"\n<p><strong>Applies to:<\/strong>&nbsp;<img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/sql\/includes\/media\/yes-icon.png?view=sql-server-ver15\" alt=\"yes\">SQL Server (all supported versions)&nbsp;<img decoding=\"async\" src=\"https:\/\/docs.microsoft.com\/en-us\/sql\/includes\/media\/yes-icon.png?view=sql-server-ver15\" alt=\"yes\">&nbsp;SSIS Integration Runtime in Azure Data Factory<\/p>\n\n\n\n<p>This tutorial walks you through the process to extract the\u00a0<strong>Employees<\/strong>\u00a0collection from the sample\u00a0<strong>Northwind<\/strong>\u00a0OData service (<a href=\"https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/<\/a>), and then load it into a flat-file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-create-an-integration-services-project\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/integration-services\/data-flow\/tutorial-using-the-odata-source?view=sql-server-ver15#1-create-an-integration-services-project\"><\/a>1. Create an Integration Services project<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Launch&nbsp;<strong>SQL Server Data Tools<\/strong>&nbsp;or Visual Studio.<\/li><li>Click&nbsp;<strong>File<\/strong>, point to&nbsp;<strong>New<\/strong>, and click&nbsp;<strong>Project<\/strong>.<\/li><li>In the&nbsp;<strong>New Project<\/strong>&nbsp;dialog box, expand&nbsp;<strong>Installed<\/strong>, expand&nbsp;<strong>Templates<\/strong>, expand&nbsp;<strong>Business Intelligence<\/strong>, and click&nbsp;<strong>Integration Services<\/strong>.<\/li><li>Select&nbsp;<strong>Integration Services Project<\/strong>&nbsp;for the type of project.<\/li><li>Enter a&nbsp;<strong>name<\/strong>&nbsp;and select a&nbsp;<strong>location<\/strong>&nbsp;for the project, and click&nbsp;<strong>OK<\/strong>.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-add-and-configure-an-odata-source\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/integration-services\/data-flow\/tutorial-using-the-odata-source?view=sql-server-ver15#2-add-and-configure-an-odata-source\"><\/a>2. Add and configure an OData Source<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Drag-drop a&nbsp;<strong>Data Flow Task<\/strong>&nbsp;from the&nbsp;<strong>SSIS Toolbox<\/strong>&nbsp;on to the control flow design surface of your SSIS package.<\/li><li>Click the&nbsp;<strong>Data Flow<\/strong>&nbsp;tab, or double-click on the&nbsp;<strong>Data Flow Task<\/strong>&nbsp;to open the Data Flow design surface.<\/li><li>Drag-drop&nbsp;<strong>OData Source<\/strong>&nbsp;from the&nbsp;<strong>Common<\/strong>&nbsp;group in the&nbsp;<strong>SSIS Toolbox<\/strong>.<\/li><li>Double-click the&nbsp;<strong>OData Source<\/strong>&nbsp;component to launch the&nbsp;<strong>OData Source Editor<\/strong>&nbsp;dialog box.<\/li><li>Click&nbsp;<strong>New&#8230;<\/strong>&nbsp;to add a new OData Connection Manager.<\/li><li>Enter the OData service URL for&nbsp;<strong>Service document location<\/strong>. This URL can be the URL to the service document, or to a specific feed or entity. For the purpose of this tutorial, enter the URL to the service document:&nbsp;<a href=\"https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/<\/a>.<\/li><li>Confirm that&nbsp;<strong>Windows Authentication<\/strong>&nbsp;is selected for the&nbsp;<strong>authentication<\/strong>&nbsp;to use to access the OData Service.&nbsp;<strong>Windows Authentication<\/strong>&nbsp;is selected by default.<\/li><li>Click&nbsp;<strong>Test Connection<\/strong>&nbsp;to test the connection, and click&nbsp;<strong>OK<\/strong>&nbsp;to finish creating an instance of OData Connection Manager.<\/li><li>In the&nbsp;<strong>OData Source Editor<\/strong>&nbsp;Dialog Box, confirm that&nbsp;<strong>Collection<\/strong>&nbsp;is selected for&nbsp;<strong>Use collection on resource path<\/strong>&nbsp;option.<\/li><li>From the&nbsp;<strong>Collection<\/strong>&nbsp;drop-down list, select&nbsp;<strong>Employees<\/strong>.<\/li><li>Enter any additional OData query options or filters for&nbsp;<strong>Query Options<\/strong>. For example,&nbsp;<code>$orderby=CompanyName&amp;$top=100<\/code>. For the purpose of this tutorial, enter&nbsp;<code>$top=5<\/code>.<\/li><li>Click&nbsp;<strong>Preview<\/strong>&nbsp;to preview the data.<\/li><li>Click&nbsp;<strong>Columns<\/strong>&nbsp;in the left navigation pane to switch to the&nbsp;<strong>Columns<\/strong>&nbsp;page.<\/li><li>Select&nbsp;<strong>EmployeeID<\/strong>,&nbsp;<strong>FirstName<\/strong>, and&nbsp;<strong>LastName<\/strong>&nbsp;from&nbsp;<strong>Available External Columns<\/strong>&nbsp;by checking the check boxes.<\/li><li>Click&nbsp;<strong>OK<\/strong>&nbsp;to close the&nbsp;<strong>OData Source Editor<\/strong>&nbsp;dialog box.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-add-and-configure-a-flat-file-destination\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/integration-services\/data-flow\/tutorial-using-the-odata-source?view=sql-server-ver15#3-add-and-configure-a-flat-file-destination\"><\/a>3. Add and configure a Flat File Destination<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Now, drag-drop a&nbsp;<strong>Flat File Destination<\/strong>&nbsp;from&nbsp;<strong>SSIS Toolbox<\/strong>&nbsp;to the Data Flow design surface below the&nbsp;<strong>OData Source<\/strong>&nbsp;component.<\/li><li>Connect&nbsp;<strong>OData Source<\/strong>&nbsp;component with the&nbsp;<strong>Flat File Destination<\/strong>&nbsp;component using blue arrow.<\/li><li>Double-click on&nbsp;<strong>Flat File Destination<\/strong>. You should see the&nbsp;<strong>Flat File Destination Editor<\/strong>&nbsp;dialog box.<\/li><li>In the&nbsp;<strong>Flat File Destination Editor<\/strong>&nbsp;dialog box, click&nbsp;<strong>New<\/strong>&nbsp;to create a new flat file connection manager.<\/li><li>In the&nbsp;<strong>Flat File Format<\/strong>&nbsp;dialog box, select&nbsp;<strong>Delimited<\/strong>. Then you see the&nbsp;<strong>Flat File Connection Manager Editor<\/strong>&nbsp;dialog box.<\/li><li>In the&nbsp;<strong>Flat File Connection Manager Editor<\/strong>&nbsp;dialog box, for the&nbsp;<strong>File name<\/strong>, enter&nbsp;<code>c:\\Employees.txt<\/code>.<\/li><li>In the left navigation pane, click&nbsp;<strong>Columns<\/strong>. You can preview the data on this page.<\/li><li>Click OK to close the&nbsp;<strong>Flat File Connection Manager<\/strong>&nbsp;Editor dialog box.<\/li><li>In the&nbsp;<strong>Flat File Destination Editor<\/strong>&nbsp;dialog box, click&nbsp;<strong>Mappings<\/strong>&nbsp;in the left navigation pane. Review the mappings.<\/li><li>Click OK to close the&nbsp;<strong>Flat File Destination Editor<\/strong>&nbsp;dialog box.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-run-the-package\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/integration-services\/data-flow\/tutorial-using-the-odata-source?view=sql-server-ver15#4-run-the-package\"><\/a>4. Run the package<\/h2>\n\n\n\n<p>Run the SSIS package. Verify that the output file is created with ID, First Name, and Last Name for five employees from the OData feed.<\/p>\n\n\n\n<p>Ref: https:\/\/docs.microsoft.com\/en-us\/sql\/integration-services\/data-flow\/tutorial-using-the-odata-source?view=sql-server-ver15<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Applies to:&nbsp;SQL Server (all supported versions)&nbsp;&nbsp;SSIS Integration Runtime in Azure Data Factory This tutorial walks you through the process to extract the\u00a0Employees\u00a0collection from the sample\u00a0Northwind\u00a0OData service (https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/), and then load it into a flat-file. 1. Create an Integration Services project Launch&nbsp;SQL Server Data Tools&nbsp;or Visual Studio. Click&nbsp;File, point to&nbsp;New, and click&nbsp;Project. In the&nbsp;New Project&nbsp;dialog box, <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=3792\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,625],"tags":[957,958],"class_list":["post-3792","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-sql","tag-odata-source-to-sql","tag-odata-source-to-txt-file"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3792"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3792\/revisions"}],"predecessor-version":[{"id":3793,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3792\/revisions\/3793"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}