{"id":25791,"date":"2023-05-09T06:11:00","date_gmt":"2023-05-09T04:11:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=25791"},"modified":"2023-05-16T20:17:33","modified_gmt":"2023-05-16T18:17:33","slug":"group-multiples-tables-with-ssis","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/","title":{"rendered":"Group multiple tables with SSIS Union All"},"content":{"rendered":"\n<h4 class=\"wp-block-heading has-text-align-center\"><strong><em>Develop an SSIS package step-by-step to group data from multiple SQL Server tables into one using the Union All transformation.<\/em><\/strong><\/h4>\n\n\n\n<p>To group the contents of several tables or data sources in general, it is possible to use a SQL Union All query, here is how to do it without code with SSIS. A prerequisite for this type of query is to build all source tables with the same data structure, i.e., column type and length. Or at least at the input of the Union All component. This operation is equivalent to a classic SQL Union All query.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-create-several-tables-to-be-grouped-and-the-target-table\">1. Create several tables to be grouped and the target table<\/h2>\n\n\n\n<p>First of all, create three source tables with the same structure and insert rows into them. Each table has 16 rows, <strong>for a total of 48 rows<\/strong>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">-- Create the first customers table\nCREATE TABLE [dbo].[Customers_1](\n   [CustomerID] [int] NOT NULL,\n   [FirstName] [nvarchar](20) NULL,\n   [LastName] [nvarchar](20) NULL,\n   [City] [nvarchar](20) NULL,\n   [Country] [nvarchar](50) NULL,\n   CONSTRAINT [CustomersPKCustomerID_1] PRIMARY KEY CLUSTERED ([CustomerID] ASC)\n);\nGO\n\n-- Create the second customers table\nCREATE TABLE [dbo].[Customers_2](\n   [CustomerID] [int] NOT NULL,\n   [FirstName] [nvarchar](20) NULL,\n   [LastName] [nvarchar](20) NULL,\n   [City] [nvarchar](20) NULL,\n   [Country] [nvarchar](50) NULL,\n   CONSTRAINT [CustomersPKCustomerID_2] PRIMARY KEY CLUSTERED ([CustomerID] ASC)\n);\nGO\n\n-- Create the third customers table\nCREATE TABLE [dbo].[Customers_3](\n   [CustomerID] [int] NOT NULL,\n   [FirstName] [nvarchar](20) NULL,\n   [LastName] [nvarchar](20) NULL,\n   [City] [nvarchar](20) NULL,\n   [Country] [nvarchar](50) NULL,\n   CONSTRAINT [CustomersPKCustomerID_3] PRIMARY KEY CLUSTERED ([CustomerID] ASC)\n);\nGO\n<\/pre>\n\n\n\n<p>Create a fourth table, the target, used to store the results, i.e., all data from the 3 sources tables.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">-- Create the target and global customers table\nCREATE TABLE [dbo].[Customers_All](\n   [CustomerID] [int] NOT NULL,\n   [FirstName] [nvarchar](20) NULL,\n   [LastName] [nvarchar](20) NULL,\n   [City] [nvarchar](20) NULL,\n   [Country] [nvarchar](50) NULL,\n   CONSTRAINT [CustomersPKCustomerID_All] PRIMARY KEY CLUSTERED ([CustomerID] ASC)\n);\nGO<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. Feed the SQL tables to be grouped with SSIS<\/h2>\n\n\n\n<p>Download this file and rename it with an .sql extension. Or run its contents directly from an SSMS window.<\/p>\n\n\n\n<div class=\"wp-block-file aligncenter\"><a id=\"wp-block-file--media-9b98717c-9573-4550-bba8-bc0abe1ca202\" href=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/insert_customers_data_in_3_tables.txt\"><strong>insert_customers_data_in_3_tables.txt<\/strong><\/a><a href=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/insert_customers_data_in_3_tables.txt\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-9b98717c-9573-4550-bba8-bc0abe1ca202\">Donwload  the SQL insert statements<\/a><\/div>\n\n\n\n<p>If you are unable to download the file because of security restrictions, then here are its contents: <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">-- table 1\nINSERT [dbo].[Customers_1] VALUES (1, N'Ali', N'Ahmed', N'Cairo', N'Egypt' );\nINSERT [dbo].[Customers_1] VALUES (2, N'Johnny', N'John', N'Toronto', N'Canada' );\nINSERT [dbo].[Customers_1] VALUES (3, N'John', N'Doe', N'Mexico City', N'Mexico' );\nINSERT [dbo].[Customers_1] VALUES (4, N'Shu', N'Abbas', N'Paris', N'France' );\nINSERT [dbo].[Customers_1] VALUES (5, N'Jeane', N'Raffin', N'Liushutun', N'China' );\nINSERT [dbo].[Customers_1] VALUES (6, N'Legra', N'Leate', N'B\u0142aszki', N'Poland' );\nINSERT [dbo].[Customers_1] VALUES (7, N'Sullivan', N'Goadby', N'Xiaoguwei', N'China' );\nINSERT [dbo].[Customers_1] VALUES (8, N'Tom', N'Ellams', N'Lop Buri', N'Thailand' );\nINSERT [dbo].[Customers_1] VALUES (9, N'Trace', N'Fowell', N'Sriwing', N'Indonesia' );\nINSERT [dbo].[Customers_1] VALUES (10, N'Christoffer', N'Rochford', N'Mburukullu', N'Indonesia' );\nINSERT [dbo].[Customers_1] VALUES (11, N'Dru', N'Dunridge', N'Mistrat\u00f3', N'Colombia' );\nINSERT [dbo].[Customers_1] VALUES (12, N'Dud', N'Gravenor', N'Sandaogou', N'China' );\nINSERT [dbo].[Customers_1] VALUES (13, N'Lori', N'Garshore', N'Jeziora Wielkie', N'Poland' );\nINSERT [dbo].[Customers_1] VALUES (14, N'Cordy', N'Kentish', N'Vydreno', N'Russia' );\nINSERT [dbo].[Customers_1] VALUES (15, N'Ancell', N'Wileman', N'Claresholm', N'Canada' );\nINSERT [dbo].[Customers_1] VALUES (16, N'Elsworth', N'Chantrell', N'Sumberjo', N'Indonesia' );\n\n-- table 2\nINSERT [dbo].[Customers_2] VALUES (17, N'Beverly', N'Giraudy', N'Cigembong', N'Indonesia' );\nINSERT [dbo].[Customers_2] VALUES (18, N'Tamas', N'Zavattiero', N'Jangkat', N'Indonesia' );\nINSERT [dbo].[Customers_2] VALUES (19, N'Benedick', N'Schaffler', N'Itaparica', N'Brazil' );\nINSERT [dbo].[Customers_2] VALUES (20, N'Leonard', N'Brimman', N'Moscow', N'Russia' );\nINSERT [dbo].[Customers_2] VALUES (21, N'Morton', N'Capelle', N'Uk', N'Russia' );\nINSERT [dbo].[Customers_2] VALUES (22, N'Larissa', N'Rawle', N'Tembayangan Barat', N'Indonesia' );\nINSERT [dbo].[Customers_2] VALUES (23, N'Karalee', N'Wall', N'Clifden', N'Ireland' );\nINSERT [dbo].[Customers_2] VALUES (24, N'Miller', N'Shakesbye', N'Gongnong', N'China' );\nINSERT [dbo].[Customers_2] VALUES (25, N'Deidre', N'Cacacie', N'Itapeva', N'Brazil' );\nINSERT [dbo].[Customers_2] VALUES (26, N'Gerri', N'Fawcus', N'Karma', N'Belarus' );\nINSERT [dbo].[Customers_2] VALUES (27, N'Rudie', N'Helix', N'Gamut', N'Philippines' );\nINSERT [dbo].[Customers_2] VALUES (28, N'Maddi', N'Rounce', N'Gavrilov-Yam', N'Russia' );\nINSERT [dbo].[Customers_2] VALUES (29, N'Cornall', N'Beazer', N'L\u00e9rida', N'Colombia' );\nINSERT [dbo].[Customers_2] VALUES (30, N'Ardelia', N'Pearcehouse', N'Fontenay-sous-Bois', N'France' );\nINSERT [dbo].[Customers_2] VALUES (31, N'Adrian', N'Legh', N'Porto Velho', N'Brazil' );\nINSERT [dbo].[Customers_2] VALUES (32, N'Buiron', N'Eads', N'G\u00f6teborg', N'Sweden' );\n\n-- table 3\nINSERT [dbo].[Customers_3] VALUES (33, N'Danette', N'Howick', N'Mombasa', N'Kenya' );\nINSERT [dbo].[Customers_3] VALUES (34, N'Geno', N'Hannaway', N'Bantuanon', N'Philippines' );\nINSERT [dbo].[Customers_3] VALUES (35, N'Kaleb', N'Hoovart', N'Largo', N'United States' );\nINSERT [dbo].[Customers_3] VALUES (36, N'Yanaton', N'Coneybeare', N'Yanqi', N'China' );\nINSERT [dbo].[Customers_3] VALUES (37, N'Jaimie', N'Zincke', N'Greeley', N'United States' );\nINSERT [dbo].[Customers_3] VALUES (38, N'Bonnibelle', N'Dorman', N'Canhestros', N'Portugal' );\nINSERT [dbo].[Customers_3] VALUES (39, N'Baxter', N'Howland', N'Finzes', N'Portugal' );\nINSERT [dbo].[Customers_3] VALUES (40, N'Elmira', N'Dary', N'Lubao', N'China' );\nINSERT [dbo].[Customers_3] VALUES (41, N'Beitris', N'Teresi', N'Impendle', N'South Africa' );\nINSERT [dbo].[Customers_3] VALUES (42, N'Gustavo', N'Poston', N'Tuquan', N'China' );\nINSERT [dbo].[Customers_3] VALUES (43, N'Renae', N'Macenzy', N'Al Ghayl', N'Yemen' );\nINSERT [dbo].[Customers_3] VALUES (44, N'Solly', N'Davydenko', N'Durham', N'United States' );\nINSERT [dbo].[Customers_3] VALUES (45, N'Herve', N'Baxandall', N'Ponggeok', N'Indonesia' );\nINSERT [dbo].[Customers_3] VALUES (46, N'Page', N'Meek', N'Gufeng', N'China' );\nINSERT [dbo].[Customers_3] VALUES (47, N'Cosme', N'Cranage', N'Willowmore', N'South Africa' );\nINSERT [dbo].[Customers_3] VALUES (48, N'Lind', N'Bransden', N'Laval', N'France' );<\/pre>\n\n\n\n<p>Then check the number of lines in each table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">select count(*) from [Customers_1];\nselect count(*) from [Customers_2];\nselect count(*) from [Customers_3];<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"400\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-1-check-3-source-tables.jpg\" alt=\"Check the number of rows in each table with an SQL query from SSMS\" class=\"wp-image-13540\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-1-check-3-source-tables.jpg 720w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-1-check-3-source-tables-300x167.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><figcaption class=\"wp-element-caption\"><em>Check the number of rows in each table with an SQL query from SSMS<\/em><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">3. Create an SSIS data stream with the Union All transformation<\/h2>\n\n\n\n<p>Use as many sources as there are tables to be grouped in the SSIS package. To make the component work, you need at least 2 tables, and the structure of the columns to be grouped must be identical.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Add three <strong><em>OLE DB Source<\/em><\/strong> components and rename them explicitly.<\/li>\n\n\n\n<li>Add the <strong><em>Union All<\/em><\/strong> transformation.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"340\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-2-add-ole-db-sources.jpg\" alt=\"Add 3 OLE DB sources and the Union All transformation to the SSIS data flow\" class=\"wp-image-13546\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-2-add-ole-db-sources.jpg 720w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-2-add-ole-db-sources-300x142.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><figcaption class=\"wp-element-caption\"><em>Add 3 OLE DB sources and the Union All transformation to the SSIS data flow<\/em><\/figcaption><\/figure><\/div>\n\n\n<p>Configure each Source to point to the corresponding customer table.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"380\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-3-configure-first-table.jpg\" alt=\"Set up the first source table for the Union All SSIS\" class=\"wp-image-13555\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-3-configure-first-table.jpg 600w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-3-configure-first-table-300x190.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption class=\"wp-element-caption\"><em>Set up the first source table for the Union All SSIS<\/em><\/figcaption><\/figure><\/div>\n\n\n<p>This example is deliberately simple because all the tables have the same structure. The mapping of columns is therefore automatic because SSIS is based on the names of the columns in the links between components. Naming the sources and targets as much as possible therefore greatly facilitates the <a href=\"https:\/\/expert-only.com\/en\/ssis\/create-a-simple-ssis-data-flow\/\">development of Integration Services data flows.<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"380\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-4-configure-second-table.jpg\" alt=\"Set up the second source table for the Union All SSIS\" class=\"wp-image-13559\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-4-configure-second-table.jpg 600w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-4-configure-second-table-300x190.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption class=\"wp-element-caption\"><em>Set up the second source table for the Union All SSIS<\/em><\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"380\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-5-configure-third-table.jpg\" alt=\"Set up the third source table to be grouped using the SSIS Union All\" class=\"wp-image-13563\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-5-configure-third-table.jpg 600w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-5-configure-third-table-300x190.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption class=\"wp-element-caption\"><em>Set up the third source table to be grouped using the SSIS Union All<\/em><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">4. Check the SSIS Union All component<\/h2>\n\n\n\n<p>After configuring all the source tables, then link the <strong><em>OLE DB Source components<\/em><\/strong> to the <strong><em>Union All transformation<\/em><\/strong>. Link the tables in order to facilitate control and correction of the mapping in the component.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"340\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-6-link-tables-to-transformation.jpg\" alt=\"Link the 3 source SSIS components to the transformation to aggregate the data\" class=\"wp-image-13569\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-6-link-tables-to-transformation.jpg 720w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-6-link-tables-to-transformation-300x142.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><figcaption class=\"wp-element-caption\"><em>Link the 3 source SSIS components to the transformation to group the data<\/em><\/figcaption><\/figure><\/div>\n\n\n<p>Open the transformation component and check the columns. Here all columns have identical names and types. It is possible to perform the following operations.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Rename the output columns by clicking and editing the name.<\/li>\n\n\n\n<li>Change the source columns by clicking on a row and changing the source from the source.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"340\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-7-check-merge-mapping.jpg\" alt=\"Mapping of source columns to group using the SSIS Union All transformation\" class=\"wp-image-13579\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-7-check-merge-mapping.jpg 720w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-7-check-merge-mapping-300x142.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><figcaption class=\"wp-element-caption\"><em>Mapping of source columns to group using the SSIS Union All transformation<\/em><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">5. Set up the destination table<\/h2>\n\n\n\n<p>Finally add an <strong><em>OLE DB Destination component<\/em><\/strong> and point to the customers table with the grouped data. That is the <em>Customers_All<\/em> table, created in step 1 of this tutorial.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"380\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-8-configure-target-table-1.jpg\" alt=\"Configure the target table to store the joined data\" class=\"wp-image-13593\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-8-configure-target-table-1.jpg 600w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-8-configure-target-table-1-300x190.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption class=\"wp-element-caption\"><em>Configure the target table to store the grouped data<\/em><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">6. Run the SSIS package to combine data from source tables<\/h2>\n\n\n\n<p>Now press F5 to execute the package and the data flow and moreover check the outcome. Indeed, the goal here is to aggregate the 16 rows of data from each source table into the single target table and have 48 different lines. It is the equivalent of the T-SQL Union All <a href=\"https:\/\/en.wikipedia.org\/wiki\/Set_operations_(SQL)\" target=\"_blank\" rel=\"noreferrer noopener\">operator<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"480\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-9-execute-the-merge.jpg\" alt=\"Successfully execution of the SSIS package storing data from the three tables into one\" class=\"wp-image-13601\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-9-execute-the-merge.jpg 740w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-9-execute-the-merge-300x195.jpg 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><figcaption class=\"wp-element-caption\"><em>Successfully execution of the SSIS package storing data from the three tables into one<\/em><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">7. Check the results with an SQL query from SSMS<\/h2>\n\n\n\n<p>For the last step, check the data inserted in the target table with an SQL query to be executed from SSMS.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"mssql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SELECT COUNT(*) AS [Lines] FROM [Customers_All];\n<\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"280\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-10-check-merged-data.jpg\" alt=\"The target table contains the 48 rows of the 3 source tables.\" class=\"wp-image-13605\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-10-check-merged-data.jpg 640w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-10-check-merged-data-300x131.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption class=\"wp-element-caption\"><em>The target table contains the 48 rows of the 3 source tables.<\/em><\/figcaption><\/figure><\/div>\n\n\n<p>It is also possible to control the rows of a SQL Server table directly from the OLE DB SSIS components.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"620\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-11-check-merged-data-with-viewer-1.jpg\" alt=\"Read data from the SQL Server target table directly from the SSIS Viewer\" class=\"wp-image-13618\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-11-check-merged-data-with-viewer-1.jpg 740w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/10\/ssis-group-tables-union-all-11-check-merged-data-with-viewer-1-300x251.jpg 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><figcaption class=\"wp-element-caption\">Read data from the SQL Server target table directly from the SSIS Viewer<\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Conclusion on using SSIS Union All to group multiple tables<\/h3>\n\n\n\n<p>To conclude, this illustrated course explains general concepts and illustrates the use of the SSIS data grouping component with a basic case study. In projects, it is important to prepare tables and their structures in advance to ensure smooth mapping and consistent data types throughout the ETL project development process.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Develop an SSIS package step-by-step to group data from multiple SQL Server tables into one using the Union All transformation. To group the contents of several tables or data sources in general, it is possible to use a SQL <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\" title=\"Group multiple tables with SSIS Union All\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":10319,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[516],"tags":[],"class_list":{"0":"post-25791","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-ssis"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Group multiple tables with SSIS Union All - Integration Services<\/title>\n<meta name=\"description\" content=\"Step-by-step course to develop an SSIS package to group data from multiple SQL Server tables into one using the Union All transformation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Group multiple tables with SSIS Union All\" \/>\n<meta property=\"og:description\" content=\"Step-by-step course to develop an SSIS package to group data from multiple SQL Server tables into one using the Union All transformation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-09T04:11:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-16T18:17:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"Group multiple tables with SSIS Union All\",\"datePublished\":\"2023-05-09T04:11:00+00:00\",\"dateModified\":\"2023-05-16T18:17:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\"},\"wordCount\":778,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg\",\"articleSection\":[\"SSIS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\",\"url\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\",\"name\":\"Group multiple tables with SSIS Union All - Integration Services\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg\",\"datePublished\":\"2023-05-09T04:11:00+00:00\",\"dateModified\":\"2023-05-16T18:17:33+00:00\",\"description\":\"Step-by-step course to develop an SSIS package to group data from multiple SQL Server tables into one using the Union All transformation.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Group multiple tables with SSIS Union All\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Group multiple tables with SSIS Union All - Integration Services","description":"Step-by-step course to develop an SSIS package to group data from multiple SQL Server tables into one using the Union All transformation.","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:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/","og_locale":"en_US","og_type":"article","og_title":"Group multiple tables with SSIS Union All","og_description":"Step-by-step course to develop an SSIS package to group data from multiple SQL Server tables into one using the Union All transformation.","og_url":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2023-05-09T04:11:00+00:00","article_modified_time":"2023-05-16T18:17:33+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"Group multiple tables with SSIS Union All","datePublished":"2023-05-09T04:11:00+00:00","dateModified":"2023-05-16T18:17:33+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/"},"wordCount":778,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg","articleSection":["SSIS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/","url":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/","name":"Group multiple tables with SSIS Union All - Integration Services","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg","datePublished":"2023-05-09T04:11:00+00:00","dateModified":"2023-05-16T18:17:33+00:00","description":"Step-by-step course to develop an SSIS package to group data from multiple SQL Server tables into one using the Union All transformation.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/black-white-city-street-026A76F002A_1920x1080.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/ssis\/group-multiples-tables-with-ssis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"Group multiple tables with SSIS Union All"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/25791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=25791"}],"version-history":[{"count":0,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/25791\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/10319"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=25791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=25791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=25791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}