{"id":1351,"date":"2012-06-12T00:00:00","date_gmt":"2012-06-12T00:00:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/ssis-basics-adding-data-flow-to-your-package\/"},"modified":"2021-06-03T16:45:25","modified_gmt":"2021-06-03T16:45:25","slug":"ssis-basics-adding-data-flow-to-your-package","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/databases\/sql-server\/bi-sql-server\/ssis-basics-adding-data-flow-to-your-package\/","title":{"rendered":"SSIS Basics: Adding Data Flow to Your Package"},"content":{"rendered":"<div id=\"pretty\">\n<p class=\"start\">In my previous article, &#8220;<a href=\"http:\/\/www.simple-talk.com\/sql\/ssis\/ssis-basics-setting-up-your-initial-package\/\">SSIS Basics: Setting Up Your Initial Package<\/a>&#8220;, I showed you how to create an SSIS package and configure connection managers, data sources, and data source views. In this article, I will show you how to use some of those data connections to retrieve data from a SQL Server database and load the data into an<strong> Excel <\/strong>file. I will also show you how to add a computed column based on data derived from the data flow. In addition, I will demonstrate how to run the package. <\/p>\n<p>SSIS supports many control flow items that manage a package&#8217;s workflow, but the one I think to be the most important and most often used is the <strong>Data Flow<\/strong> task. For this reason, I focus on that task in this article. In future articles, I&#8217;ll cover other control flow items. <\/p>\n<div class=\"note\">\n<p class=\"note\"><strong>Note:<\/strong><br \/>If you want to try out the examples in this article, you&#8217;ll need to create an <strong>OLE DB connection manager<\/strong> that points to the <strong>AdventureWorks<\/strong> database and a <strong>Flat File<\/strong> connection manager that points to an<strong> Excel <\/strong>file. You can find details about how to set up these connection managers in my previous article, which is referenced above. I created the examples shown in this article and the last one on a local instance of SQL Server 2008 R2. <\/p>\n<\/div>\n<h2>Adding a Data Flow Task <\/h2>\n<p>Our goal in creating this package is to move data from a SQL Server database to an<strong> Excel <\/strong>file. As part of that goal, we also want to insert an additional column into the<strong> Excel <\/strong>file that&#8217;s based on derived data. <\/p>\n<p>To carry out our goal, we must add a <strong>Data Flow<\/strong> task to our control flow. The task lets us retrieve data from our data source, transform that data, and insert it into our destination, the<strong> Excel <\/strong>file. The <strong>Data Flow<\/strong> task is one of the most important and powerful components in SSIS and as such has it&#8217;s own workspace, which is represented by the <strong>Data Flow<\/strong> tab in <strong>SSIS Designer<\/strong>, as shown in Figure 1. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image001.jpg\" alt=\"1506-image001.jpg\" \/><\/p>\n<p class=\"caption\">Figure 1: The Data Flow tab in SSIS Designer <\/p>\n<p>Before we can do anything on the <strong>Data Flow<\/strong> tab, we must first add a <strong>Data Flow<\/strong> task to our control flow. To add the task, drag it from the <strong>Control Flow Items<\/strong> window to the Control Flow tab of the <strong>SSIS Designer<\/strong> screen, as illustrated in Figure 2. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image002.jpg\" alt=\"1506-image002.jpg\" \/><\/p>\n<p class=\"caption\">Figure 2: Adding a Data Flow task to the control flow <\/p>\n<p>To configure the data flow, double-click the <strong>Data Flow<\/strong> task in the control flow. This will move you to the <strong>Data Flow<\/strong> tab, shown in Figure 3. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image003.jpg\" alt=\"1506-image003.jpg\" \/><\/p>\n<p class=\"caption\">Figure 3: The Data Flow tab in SSIS Designer <\/p>\n<h2>Configuring the Data Flow <\/h2>\n<p>You configure a <strong>Data Flow<\/strong> task by adding components to the <strong>Data Flow<\/strong> tab. SSIS supports three types of data flow components: <\/p>\n<ul>\n<li><strong>Sources:<\/strong> Where the data comes from  <\/li>\n<li><strong>Transformations:<\/strong> How you can modify the data  <\/li>\n<li><strong>Destinations:<\/strong> Where you want to put the data <\/li>\n<\/ul>\n<p>A <strong>Data Flow<\/strong> task will always start with a source and will usually end with a destination, but not always. You can also add as many transformations as necessary to prepare the data for the destination. For example, you can use the <strong>Derived Column<\/strong> transformation to add a computed column to the data flow, or you can use a <strong>Conditional Split<\/strong> transformation to split data into different destinations based on specified criteria. This and other components will be explained in future articles. <\/p>\n<p>To add components to the <strong>Data Flow<\/strong> task, you need to open the <strong>Toolbox<\/strong> if it&#8217;s not already open. To do this, point to the <strong>View<\/strong> menu and then click ToolBox, as shown in Figure 4. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image004.jpg\" alt=\"1506-image004.jpg\" \/><\/p>\n<p class=\"caption\">Figure 4: Opening the Toolbox to view the data flow components <\/p>\n<p>At the left side of the <strong>Data Flow<\/strong> tab, you should now find the <strong>Toolbox<\/strong> window, which lists the various components you can add to your data flow. The <strong>Toolbox<\/strong> organizes the components according to their function, as shown in Figure 5. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image005.png\" alt=\"1506-image005.png\" \/><\/p>\n<p class=\"caption\">Figure 5: The component categories as they appear in the Toolbox <\/p>\n<p>To view the actual components, you must expand the categories. For example, to view the source components, you must expand the <strong>Data Flow Sources<\/strong> category, as shown in Figure 6 <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image006.png\" alt=\"1506-image006.png\" \/><\/p>\n<p class=\"caption\">Figure 6: Viewing the data flow source components <\/p>\n<h2>Adding an OLE DB Source <\/h2>\n<p>The first component we&#8217;re going to add to the data flow is a source. Because we&#8217;re going to be retrieving data from a SQL Server database, we&#8217;ll use an <strong>OLE DB<\/strong> source. To add the component, expand the <strong>Data Flow Sources<\/strong> category in the <strong>Toolbox<\/strong>. Then drag an <strong>OLE DB<\/strong> source from to the <strong>Data Flow<\/strong> window. Your data flow should now look similar to Figure 7. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image007.jpg\" alt=\"1506-image007.jpg\" \/><\/p>\n<p class=\"caption\">Figure 7: Adding an OLE DB source to your data flow <\/p>\n<p>You will see that we have a new item named <strong>OLE DB<\/strong> Source. You can rename the component by right-clicking it and selecting rename. For this example, I renamed it <strong>Employees<\/strong>. <\/p>\n<p>There are several other features about the <strong>OLE DB<\/strong> source noting: <\/p>\n<ul>\n<li>A database icon is associated with that source type. Other source types will show different icons.  <\/li>\n<li>A reversed red X appears to the right of the name. This indicates that the component has not yet been properly configured.  <\/li>\n<li>Two arrows extend below the component. These are called <em>d<\/em><em>ata paths<\/em>. In this case, there is one green and one red. The green data path marks the flow of data that has no errors. The red data path redirects rows whose values are truncated or that generate an error. Together these data paths enable the developer to specifically control the flow of data, even if errors are present. <\/li>\n<\/ul>\n<p>To configure the <strong>OLE DB<\/strong> source, right-click the component and then click <strong>Edit<\/strong>. The <strong>OLE DB<\/strong> Source <strong>Edit<\/strong>or appears, as shown in Figure 8. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image008.png\" alt=\"1506-image008.png\" \/><\/p>\n<p class=\"caption\">Figure 8: Configuring the OLEDB source <\/p>\n<p>From the <strong>OLE DB connection manager<\/strong> drop-down list, select the <strong>OLE DB<\/strong> connection manager we set up in the last article, the one that connects to the <strong>AdventureWorks<\/strong> database. <\/p>\n<p>Next, you must select one of the following four options from the <strong>Data access mode<\/strong> drop-down list: <\/p>\n<ul>\n<li>Table or view  <\/li>\n<li>Table name or view name variable  <\/li>\n<li>SQL command  <\/li>\n<li>SQL command from variable <\/li>\n<\/ul>\n<p>For this example, we&#8217;ll select the <strong>Table or View<\/strong> option because we&#8217;ll be retrieving our data through the <strong>uvw_GetEmployeePay<strong>Rate<\/strong><\/strong> view, which returns the latest employee pay raise and the amount of that raise. Listing 1 shows the Transact-SQL used to create the view in the <strong>AdventureWorks<\/strong> database. <\/p>\n<pre class=\"lang:tsql theme:ssms2012\">CREATE VIEW uvw_GetEmployeePayRate\nAS\n    SELECT  H.EmployeeID ,\n            RateChangeDate ,\n            Rate\n    FROM    HumanResources.EmployeePayHistory H\n            JOIN ( SELECT   EmployeeID ,\n                            MAX(RateChangeDate) AS [MaxDate]\n                   FROM     HumanResources.EmployeePayHistory\n                   GROUP BY EmployeeID\n                 ) xx ON H.EmployeeID = xx.EmployeeID\n                         AND H.RateChangeDate = xx.MaxDate\nGO<\/pre>\n<p class=\"caption\">Listing 1: The <strong>uvw_GetEmployeePayRate<\/strong> view definition <\/p>\n<p>After you ensure that Table or view is selected in the <strong>Data access mode<\/strong> drop-down list, select the <strong>uvw_GetEmployeePay<strong>Rate<\/strong><\/strong> view from the <strong>Name of the table or the view<\/strong> drop-down list. Now go to the <strong>Columns<\/strong> page to select the columns that will be returned from the data source. By default, all columns are selected. Figure 9 shows the columns (<strong>EmployeeID<\/strong>, <strong><strong>Rate<\/strong>ChangeDate<\/strong>, and <strong>Rate<\/strong>) that will be added to the data flow for our package, as they appear on the <strong>Columns<\/strong> page. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image009.jpg\" alt=\"1506-image009.jpg\" \/><\/p>\n<p class=\"caption\">Figure 9: The Columns page of the OLE DB Source Editor <\/p>\n<p>If there are columns you don&#8217;t wish to use, you can simply uncheck them in the <strong>Available External Columns<\/strong> box. <\/p>\n<p>Now click on the <strong>Error Output<\/strong> page (shown in Figure 10) to view the actions that the SSIS package will take if it encounters errors. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image010.jpg\" alt=\"1506-image010.jpg\" \/><\/p>\n<p class=\"caption\">Figure 10: The Error Output page of the OLE DB Source Editor <\/p>\n<p>By default, if there is an error or truncation, the component will fail. You can override the default behavior, but explaining how to do that is beyond the scope of this article. You&#8217;ll learn about error handling in future articles. <\/p>\n<p>Now return to the <strong>Connection Manager<\/strong> page and click the <strong>Preview<\/strong> button to view a sample dataset in the <strong>Preview Query Results<\/strong> window, shown in Figure 11. Previewing the data ensures that what is being returned is what you are expecting. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image011.jpg\" alt=\"1506-image011.jpg\" \/><\/p>\n<p class=\"caption\">Figure 11: Previewing a sample dataset <\/p>\n<p>After you&#8217;ve configured the <strong>OLE DB<\/strong> Source component, click <strong>OK<\/strong>. <\/p>\n<h2>Adding a Derived Column Transformation <\/h2>\n<p>The next step in configuring our data flow is to add a transformation component. In this case, we&#8217;ll add the <strong>Derived Column<\/strong> transformation to create a column that calculates the annual pay increase for each employee record we retrieve through the <strong>OLE DB<\/strong> source. <\/p>\n<p>To add the component, expand the <strong>Data Flow Transformations<\/strong> category in the <strong>Toolbox<\/strong> window, and drag the <strong>Derived Column<\/strong> transformation (shown in Figure 12) to the <strong>Data Flow<\/strong> tab design surface. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image012.jpg\" alt=\"1506-image012.jpg\" \/><\/p>\n<p class=\"caption\">Figure 12: The Derived Column transformation as its listed in the Toolbox <\/p>\n<p>Drag the green data path from the <strong>OLE DB<\/strong> source to the <strong>Derived Column<\/strong> transformation to associate the two components, as shown in Figure 13. (If you don&#8217;t connect the two components, they won&#8217;t be linked and, as a result, you won&#8217;t be able to edit the transformation.) <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image013.jpg\" alt=\"1506-image013.jpg\" \/><\/p>\n<p class=\"caption\">Figure 13: Using the data path to connect the two components <\/p>\n<p>The next step is to configure the <strong>Derived Column<\/strong> component. Double-click the component to open the <strong>Derived Column<\/strong> Transformation <strong>Edit<\/strong>or, as shown in Figure 14. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image014.jpg\" alt=\"1506-image014.jpg\" \/><\/p>\n<p class=\"caption\">Figure 14: Configuring the Derived Column transformation <\/p>\n<p>This editor is made up of three regions, which I&#8217;ve labeled <strong>1<\/strong>, <strong>2<\/strong> and <strong>3<\/strong>: <\/p>\n<ol>\n<li>Objects you can use as a starting point. For example you can either select columns from your data flow or select a variable. (We will be working with variables in a future article.)  <\/li>\n<li>Functions and operators you can use in your derived column expression. For example, you can use a mathematical function to calculate data returned from a column or use a date\/time function to extract the year from a selected date.  <\/li>\n<li>Workspace where you build one or more derived columns. Each row in the grid contains the details necessary to define a derived column. <\/li>\n<\/ol>\n<p>For this exercise, we&#8217;ll be creating a derived column that calculates a pay raise for employees. The first step is to select the existing column that will be the basis for our new column. <\/p>\n<p>To select the column, expand the <strong>Columns<\/strong> node, and drag the <strong>Rate<\/strong> column to <strong>the <strong>Expression<\/strong><\/strong> column of the first row in the derived columns grid, as shown in Figure 15. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image015.jpg\" alt=\"1506-image015.jpg\" \/><\/p>\n<p class=\"caption\">Figure 15: Adding a column to the Expression column of the derived column grid <\/p>\n<p>When you add your column to the <strong><strong>Expression<\/strong><\/strong> column, SSIS prepopulates the other columns in that row of the grid, as shown in Figure 16. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image016.jpg\" alt=\"1506-image016.jpg\" \/><\/p>\n<p class=\"caption\">Figure 16: Prepopulated values in derived column grid <\/p>\n<p>As you can see, SSIS has assigned our derived column the name <strong>Derived Column 1<\/strong> and set the <strong>Derived Column<\/strong> value to <strong>&lt;add as new column&gt;<\/strong>. In addition, our <strong>[Rate]<\/strong> field now appears in the <strong>Expression<\/strong> column, and the <strong>currency[DT_CY]<\/strong> value has been assigned to the <strong>Data Type<\/strong> column. <\/p>\n<p>You can change the <strong>Derived Column<\/strong> Name value by simply typing a new name in the box. For this example, I&#8217;ve renamed the column <strong>NewPayRate<\/strong>. <\/p>\n<p>For the <strong>Derived Column<\/strong> value, you can choose to add a new column to your data flow (which is the default value, <strong>&lt;add as new column&gt;<\/strong>) or to replace one of the existing columns in your data flow. In this instance, we&#8217;ll add a new column, but there may be times when overwriting a column is required. <\/p>\n<p>The data type is automatically created by the system and can&#8217;t be changed at this stage. <\/p>\n<p>Our next step is to refine our expression. Currently, because only the <strong>Rate<\/strong> column is included in the expression, the derived column will return the existing values in that column. However, we want to calculate a new pay rate. The first step, then, is to add an operator. To view the list of available operators, expand the list and scroll through them. Some of the operators are for string functions and some for math functions. <\/p>\n<p>To increase the employee&#8217;s pay rate by 5%, we&#8217;ll use the following calculation: <\/p>\n<p><strong>[Rate] * 1.05<\/strong> <\/p>\n<p>To do this in the <strong>Expression<\/strong> box, either type the multiplication operator (*), or drag it from the list of operators to our expression (just after the column name), and then type 1.05, as shown in Figure 17. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image017.jpg\" alt=\"1506-image017.jpg\" \/><\/p>\n<p class=\"caption\">Figure 17: Defining an expression for our derived column <\/p>\n<p>You will see that the <strong>Data Type<\/strong> has now changed to <strong>numeric [DT_NUMERIC]<\/strong>. <\/p>\n<p>Once you are happy with the expression, click on OK to complete the process. You will be returned to the <strong>Data Flow<\/strong> tab. From here, you can rename the <strong>Derived Column<\/strong> transformation to clearly show what it does. Again, there are two data paths to use to link to further transformations or to connect to destinations. <\/p>\n<h2>Adding an Excel Destination <\/h2>\n<p>Now we need to add a destination to our data flow to enable us to export our results into an<strong> Excel <\/strong>spreadsheet. <\/p>\n<p>To add the destination, expand the <strong>Data Flow<\/strong> Destinations category in the <strong>Toolbox<\/strong>, and drag the <strong>Excel<\/strong> destination to the <strong>SSIS Designer<\/strong> workspace, as shown in Figure 18. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image018.jpg\" alt=\"1506-image018.jpg\" \/><\/p>\n<p class=\"caption\">Figure 18: Adding an Excel destination to your data flow <\/p>\n<p>Now connect the green data path from the <strong>Derived Column<\/strong> transformation to the <strong>Excel<\/strong> destination to associate the two components, as shown in Figure 19. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image019.jpg\" alt=\"1506-image019.jpg\" \/><\/p>\n<p class=\"caption\">Figure 19: Connecting the data path from the transformation to the destination <\/p>\n<p>As you can see, even though we have connected the <strong>PayRate<\/strong> transformation to the<strong> Excel <\/strong>destination, we still have the reversed red X showing us that there is a connection issue. This is because we have not yet selected the connection manager or linked the data flow columns to those in the <strong>Excel<\/strong> destination. <\/p>\n<p>Next, right-click the <strong>Excel<\/strong> destination, and click <strong>Edit<\/strong>. This launches the <strong>Excel Destination Editor <\/strong>dialog box,&#160;shown in Figure 20. On the <strong>Connection Manager<\/strong> page,&#160;under <strong>OLE DB connection manager<\/strong>, click on the <strong>New <\/strong>button then under <strong>Excel File Path<\/strong> click on the Browse button and select the file you created in the previous article and click on OK, then under <strong>Name of the Excel Sheet<\/strong> select the appropriate sheet from the file. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image020.jpg\" alt=\"1506-image020.jpg\" \/><\/p>\n<p class=\"caption\">Figure 20: Configuring the Excel destination component <\/p>\n<p>At the bottom of the <strong>Connection Manager<\/strong> page, you&#8217;ll notice a message that indicates we haven&#8217;t mapped the source columns with the destination columns. To do this, go to the <strong>Mappings<\/strong> page (shown in Figure 21) and ensure that the columns in the data flow (the input columns) map correctly to the columns in the destination<strong> Excel <\/strong>file. The package will make a best guess based on field names; however, for this example, I have purposefully named my columns in the excel spreadsheet differently from those in the source database so they wouldn&#8217;t be matched automatically. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image021.jpg\" alt=\"1506-image021.jpg\" \/><\/p>\n<p class=\"caption\">Figure 21: The Mappings page of the Excel Destination Editor <\/p>\n<p>To match the remaining columns, click the column name in the <strong>Input Column<\/strong> grid at the bottom of the page, and select the correct column. As you select the column, the list will be reduced so that only those columns not linked are available. At the same time, the source and destination columns in the top diagram will be connected by arrows, as shown in Figure 22. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image022.jpg\" alt=\"1506-image022.jpg\" \/><\/p>\n<p class=\"caption\">Figure 22: Mapping the columns between the data flow and the destination <\/p>\n<p>Once you&#8217;ve properly mapped the columns, click <strong>OK<\/strong>. The <strong>Data Flow<\/strong> tab should now look similar to the screenshot in Figure 23. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image023.jpg\" alt=\"1506-image023.jpg\" \/><\/p>\n<p class=\"caption\">Figure 23: The configured data flow in your SSIS package <\/p>\n<h2>Running an SSIS Package in BIDS <\/h2>\n<p>Now all we need to do is execute the package and see if it works. To do this, click the <strong>Execute<\/strong> button. It&#8217;s the green arrow on the toolbar, as shown in Figure 24. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image024.png\" alt=\"1506-image024.png\" \/><\/p>\n<p class=\"caption\">Figure 24: Clicking the Execute button to run your SSIS package <\/p>\n<p>As the package progresses through the data flow components, each one will change color. The component will turn yellow while it is running, then turn green or red on completion. If it turns green, it has run successfully, and if it turns red, it has failed. Note, however, that if a component runs too quickly, you won&#8217;t see it turn yellow. Instead, it will go straight from white to green or red. <\/p>\n<p>The <strong>Data Flow<\/strong> tab also shows the number of rows that are processed along each step of the way. That number is displayed next to the data path. For our example package, 290 rows were processed between the <strong>Employees<\/strong> source and the <strong>PayRate<\/strong> transformation, and 290 rows were processed between the transformation and the<strong> Excel <\/strong>destination. Figure 25 shows the data flow after the three components ran successfully. Note that the number of processed rows are also displayed. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image025.jpg\" alt=\"1506-image025.jpg\" \/><\/p>\n<p class=\"caption\">Figure 25: The data flow after if has completed running <\/p>\n<p>You can also find details about the package&#8217;s execution on the <strong>Progress<\/strong> tab (shown in Figure 26). The tab displays each step of the execution process. If there is an error, a red exclamation mark is displayed next to the step&#8217;s description. If there is a warning, a yellow exclamation mark is displayed. We will go into resolving errors and how to find them in a future article. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image026.jpg\" alt=\"1506-image026.jpg\" \/><\/p>\n<p class=\"caption\">Figure 26: The Progress tab in SSIS Designer <\/p>\n<p>Now all that&#8217;s needed is to check the<strong> Excel <\/strong>file to ensure that the data was properly added. You should expect to see results similar to those in Figure 27. <\/p>\n<p class=\"illustration\"><img decoding=\"async\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/imported\/1506-image027.jpg\" alt=\"1506-image027.jpg\" \/><\/p>\n<p class=\"caption\">Figure 27: Reviewing the Excel file after package execution <\/p>\n<h2>Summary <\/h2>\n<p>In this article of the &#8220;SSIS Basics&#8221; series, I&#8217;ve shown you how to add the data flow to your SSIS package in order to retrieve data from a SQL Server database and load it into an<strong> Excel <\/strong>file. I&#8217;ve also shown you how to add a derived column that calculates the data to be inserted into the file. In addition, I&#8217;ve demonstrated how to run the package. <\/p>\n<p>In future articles, I plan to show you how to deploy the package so you can run it as part of a scheduled job or call in other ways. In addition, I&#8217;ll explain how to use variables in your package and pass them between tasks. I also aim to cover more control flow tasks and data flow components, including those that address conditional flow logic and for-each looping logic. There is much much more that can be done using SSIS, and I hope over the course of this series to cover as much information as possible. <\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Annette continues her popular series for SSIS beginners by  showing how a data flow task can be used in a package to move data from a SQL Server database to an Excel file and insert an additional column into the Excel file that&#039;s based on derived data.&hellip;<\/p>\n","protected":false},"author":10747,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[143528],"tags":[4242,5664,4168,4150,4151,4306,5665],"coauthors":[],"class_list":["post-1351","post","type-post","status-publish","format-standard","hentry","category-bi-sql-server","tag-basics","tag-data-flow","tag-database","tag-sql","tag-sql-server","tag-ssis","tag-ssis-designer"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/1351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/10747"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=1351"}],"version-history":[{"count":4,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/1351\/revisions"}],"predecessor-version":[{"id":91229,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/1351\/revisions\/91229"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=1351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=1351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=1351"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=1351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}