{"id":1412,"date":"2017-01-20T13:55:06","date_gmt":"2017-01-20T08:25:06","guid":{"rendered":"http:\/\/stepbystepschools.net\/?p=1412"},"modified":"2017-01-20T13:55:06","modified_gmt":"2017-01-20T08:25:06","slug":"working-with-execute-sql-task-in-ssis","status":"publish","type":"post","link":"https:\/\/www.stepbystepschools.net\/?p=1412","title":{"rendered":"Working with Execute SQL Task in SSIS"},"content":{"rendered":"<p><b>Error:<\/b><\/p>\n<p>The error occurred after running SSIS package which has two Execute SQL Task component out of that one is outside the \u201cForeach\u201d loop container is performing the \u201cSelect\u201d Query which the second is inside the \u201cForeach\u201d loop container is performing \u201cInsert\u201dQuery as shown in the image down below.<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg\" rel=\"attachment wp-att-1413\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-1413\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg\" alt=\"1\" width=\"627\" height=\"325\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg 627w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11-300x156.jpg 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/a><\/p>\n<p>In order to diagnose the error student of\u00a0<a href=\"http:\/\/www.learnmsbitutorials.net\/training.php\" target=\"_blank\">MSBI training<\/a> clicked on the Progress tab to see the error in more detail as shown in the image down below.<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/2-11.jpg\" rel=\"attachment wp-att-1414\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-1414\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/2-11.jpg\" alt=\"2\" width=\"627\" height=\"249\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2017\/01\/2-11.jpg 627w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2017\/01\/2-11-300x119.jpg 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/a><\/p>\n<p>Here the error says that the Variable EmployeeData does not contain a valid data. It means that the \u201cForeach\u201d loop container is executing first and then the Individual Execute SQL Task component is executing which is outside the \u201cForeach\u201d container.<\/p>\n<p>Now to understand the error more properly we will see what kind of operation we are executing. Here we want the Execute SQL Task to perform Select Query on a table and select the data and then Insert that data in another table using the Insert Query. Now here what is happening is that first the Foreach container is executing which is containing Insert Query and then the Execute SQL Task component is executing which is containing Select Query.<\/p>\n<p>So no Select and directly executing the Insert is what giving us an error in first place.<\/p>\n<p><b>Solution:<\/b><\/p>\n<p>Even after reading the error when student was not able figure out faculty of<br \/>\n<a href=\"http:\/\/www.learnmsbitutorials.net\/training.php\" target=\"_blank\">MSBI training<\/a> provided solution to this error which was very simple. There was just a need to put a connection between the Execute SQL Task component and the \u201cForeach Loop\u201d Container. For that drag output of Execute SQL Task component and drop on Foreach Loop Container as shown in the image shown below.<\/p>\n<p><a href=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/4-10.jpg\" rel=\"attachment wp-att-1415\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-1415\" src=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/4-10.jpg\" alt=\"4\" width=\"628\" height=\"344\" srcset=\"https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2017\/01\/4-10.jpg 628w, https:\/\/www.stepbystepschools.net\/wp-content\/uploads\/2017\/01\/4-10-300x164.jpg 300w\" sizes=\"(max-width: 628px) 100vw, 628px\" \/><\/a><\/p>\n<p>By doing this connection the components will execute sequentially.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Error: The error occurred after running SSIS package which has two Execute SQL Task component out of that one is outside the \u201cForeach\u201d loop container is performing the \u201cSelect\u201d Query which the second is inside the \u201cForeach\u201d loop container is &hellip; <a href=\"https:\/\/www.stepbystepschools.net\/?p=1412\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[106],"tags":[155,132,166,109,108,120,105],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Working with Execute SQL Task in SSIS - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stepbystepschools.net\/?p=1412\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Working with Execute SQL Task in SSIS - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"og:description\" content=\"Error: The error occurred after running SSIS package which has two Execute SQL Task component out of that one is outside the \u201cForeach\u201d loop container is performing the \u201cSelect\u201d Query which the second is inside the \u201cForeach\u201d loop container is &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stepbystepschools.net\/?p=1412\" \/>\n<meta property=\"og:site_name\" content=\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-20T08:25:06+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"StepByStepSchoolsSupport\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\",\"url\":\"https:\/\/www.stepbystepschools.net\/\",\"name\":\"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"description\":\"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stepbystepschools.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=1412#primaryimage\",\"url\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg\",\"contentUrl\":\"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=1412#webpage\",\"url\":\"https:\/\/www.stepbystepschools.net\/?p=1412\",\"name\":\"Working with Execute SQL Task in SSIS - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai\",\"isPartOf\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=1412#primaryimage\"},\"datePublished\":\"2017-01-20T08:25:06+00:00\",\"dateModified\":\"2017-01-20T08:25:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=1412#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stepbystepschools.net\/?p=1412\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stepbystepschools.net\/?p=1412#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stepbystepschools.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Working with Execute SQL Task in SSIS\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655\",\"name\":\"StepByStepSchoolsSupport\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g\",\"caption\":\"StepByStepSchoolsSupport\"},\"url\":\"https:\/\/www.stepbystepschools.net\/?author=40\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Working with Execute SQL Task in SSIS - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.stepbystepschools.net\/?p=1412","og_locale":"en_US","og_type":"article","og_title":"Working with Execute SQL Task in SSIS - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","og_description":"Error: The error occurred after running SSIS package which has two Execute SQL Task component out of that one is outside the \u201cForeach\u201d loop container is performing the \u201cSelect\u201d Query which the second is inside the \u201cForeach\u201d loop container is &hellip; Continue reading &rarr;","og_url":"https:\/\/www.stepbystepschools.net\/?p=1412","og_site_name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","article_published_time":"2017-01-20T08:25:06+00:00","og_image":[{"url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"StepByStepSchoolsSupport","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.stepbystepschools.net\/#website","url":"https:\/\/www.stepbystepschools.net\/","name":"Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","description":"MVC 5\/Core, AngularJS 1.x, 2.0, 4.0, Design Pattern, Architecture, SSIS, SSAS, SSRS, Data Science, Big data, Hadoop classroom training","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stepbystepschools.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/?p=1412#primaryimage","url":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg","contentUrl":"http:\/\/stepbystepschools.net\/wp-content\/uploads\/2017\/01\/1-11.jpg"},{"@type":"WebPage","@id":"https:\/\/www.stepbystepschools.net\/?p=1412#webpage","url":"https:\/\/www.stepbystepschools.net\/?p=1412","name":"Working with Execute SQL Task in SSIS - Learn MVC, Angular, Architecture, MSBI, Data Science in Mumbai","isPartOf":{"@id":"https:\/\/www.stepbystepschools.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stepbystepschools.net\/?p=1412#primaryimage"},"datePublished":"2017-01-20T08:25:06+00:00","dateModified":"2017-01-20T08:25:06+00:00","author":{"@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655"},"breadcrumb":{"@id":"https:\/\/www.stepbystepschools.net\/?p=1412#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stepbystepschools.net\/?p=1412"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.stepbystepschools.net\/?p=1412#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stepbystepschools.net\/"},{"@type":"ListItem","position":2,"name":"Working with Execute SQL Task in SSIS"}]},{"@type":"Person","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/7131e4ee1c5673879e6029d14ec2f655","name":"StepByStepSchoolsSupport","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stepbystepschools.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cecaf2a0ee369391127b0159c266979d?s=96&d=mm&r=g","caption":"StepByStepSchoolsSupport"},"url":"https:\/\/www.stepbystepschools.net\/?author=40"}]}},"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/1412"}],"collection":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1412"}],"version-history":[{"count":1,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/1412\/revisions"}],"predecessor-version":[{"id":1416,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=\/wp\/v2\/posts\/1412\/revisions\/1416"}],"wp:attachment":[{"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stepbystepschools.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}