SSIS Data Flow - How to load identical data into two places? - sql-server

How can I make identical output from a transformation go to two separate places e.g., an OLE DB destination and a DataReader destination?
Background:
I have an existing package that reads data from a text file, does some transformations, and loads the data into a SQL Server table.
Now I'm trying to make the package be callable from a reporting services report (SSRS). I'm following the instructions here: http://msdn.microsoft.com/en-us/library/ms159215.aspx
It says to make my data go into a DataReader destination and then the report will have access to that. So I want the output of the final transformation to go to both the SQL table, and the DataReader destination.

Use the MULTICAST and send to a "DataReader destination" and "OLEDB destination" in your SSIS package.
When you create your datasets in SSRS, you should use the name of the Output object from your SSIS package. Your dataset in the report should then populate with fields, data, etc that from the SSIS package.

Perhaps the Multicast step?

Related

Loading transformed excel data from Power Query into SQL Server

I am working on a little Power BI Project. The data source for this project is mostly excel files with untransformed dynamic data.
Initially I used these Excel sheets as the data source and transformed them in PowerQuery prior to building the datamodel. However, now there is a need to load the historical data into SQL server and connect Power BI to SQL as the data source.
Since the source files are not cleaned and transformed prior to importing them into Power Query, I cannot import them directly using the SSIS package - foreachloop container for multiple dynamic files.
Is there a way I can get the data back into SQL Server from PowerQuery after transformation? Is this where PowerQuery Source come into picture? What does it do exactly?
It seems that PowerQuery Source will be the best choice in your case. There is a good article on Microsoft explaining it.
You will need to to three steps:
For each file which you use as a source, create a connection with PowerQuery type in SSIS connection manager;
Using PowerQuery source, copy the full query from Power BI advanced query editor to the "Query" field in the source settings;
On "Connection Managers" tab of the source, map each power query source (each file) with the corresponding connection which you created in step 1.
The output of this source is a list of columns which you can write to the DB using usual data flow task appraoch (like mapping this source to OLE DB destination)

How to store Executable sql task result in excel file ssis

Problem is as simple Client want to store executable sql task queries result in Excel file.I have set full result set as a object but cant consume that object anywhere.
You need to export data from SQL Server to Excel using SSIS, right? In SSIS, you need to create a data flow task. Inside the data flow task you need an OLEDB data source or an ADO.NET data source. Then you need an Excel destination. Connect the source and destination and configure the mappings and other settings. More detailed instructions can be found in this tutorial: https://codingsight.com/export-data-from-sql-server-to-excel-and-text-file-via-using-ssis-package/
Add a Data Flow Task that contains a Script Component Source where you generate output rows from the recordset and an Excel Destination:
Using The SSIS Object Variable As A Data Flow Source
Implementing Recordset Source
On the other hand, you can simply use the SQL Command that you are executing in the Execute SQL Task in an OLE DB Source which is more simple.

Exporting column records from .CSV to multiple table in SQL Server using SSIS

I have a requirement to create a batch solution using SSIS package.
I am new to SSIS hence exploring this to implement my scenario.
Scenario:
An external system will dump data into .CSV file on weekly basis on
specific directory on server.
An SSIS package will be scheduled to run on weekly basis to read
that .CSV file path on server and write those data in multiple table
in SQL Server.
Task:
The source .CSV file with set of columns belong to different tables in SQL Server. Those column and data in that row should be mapped to specific columns in different tables.
My thought to ask community -
What alternatives SSIS provides which allows me to segregate each
column in .CSV file and map them to different table in SQL Server?
In .CSV I have eleven columns. As per SQL table structure, those
eleven columns are distributed into four separate tables.
I appreciate any productive advise to implement the solution.
UPDATE: Below things so far I setup/tried
I created new SSI package successfully. In Data flow so far as a
source I setup the variables to read path and file name.
I setup OLE DB datasource as destination and establish connection to
server.
I believe I have reached by completing setup with .CSV as a source
to read columns, but I am still exploring what would be ideal
destination or how OLE DB would help to consume records in different
tables.
I went through Multicast and Import Columns options. I
understand that the Multicast is mainly used to share or output
data to different destinations.
you can create four OLE DB destinations and using multicast you can route your data.
so basically multicast will pass all the 11 tables to all four destinations and there you can map only required column with your tables.
Let me know if you have any confusion.

how to load both csv and excel file in sql server using single connection manager in SSIS?

I want to load two types of file (CSV and Excel) which are placed in one folder in a signal sql server table. The no of column and column names are same in both files. How can we achieve this through SSIS using single Connection Manager?
Without doing something very over engineered in a script source task, this is not possible. Just have two connection managers, two data sources in the Data Flow and merge the two datasets with a Union All transformation.

SSIS: How to use data from dataflow task in script task?

Is there any way out there in SSIS, through which I can be able to get data first, and, then use that data inside my Script Task to generate a sqlite file.
You can use an OLE DB Connection and an OLE DB Source together to pull data out from SQL Server. Add an script task, configure it as a destination task,set the input columns an ad the code necessary to fill your sqlite tables.

Resources