Labels

Apache Hadoop (3) ASP.NET (2) AWS S3 (2) Batch Script (3) BigQuery (21) BlobStorage (1) C# (3) Cloudera (1) Command (2) Data Model (3) Data Science (1) Django (1) Docker (1) ETL (7) Google Cloud (5) GPG (2) Hadoop (2) Hive (3) Luigi (1) MDX (21) Mongo (3) MYSQL (3) Pandas (1) Pentaho Data Integration (5) PentahoAdmin (13) Polybase (1) Postgres (1) PPS 2007 (2) Python (13) R Program (1) Redshift (3) SQL 2016 (2) SQL Error Fix (18) SQL Performance (1) SQL2012 (7) SQOOP (1) SSAS (20) SSH (1) SSIS (42) SSRS (17) T-SQL (75) Talend (3) Vagrant (1) Virtual Machine (2) WinSCP (1)

Thursday, May 19, 2011

How to Connect Multiple Datasources in Different Domain through SSIS

How to connect multiple datasources in different domain via SSIS?
Example:
Let us consider I have an excel source and I need to load the data in excel sheet 1 to 3 different databases (two in same domain A and 1 in different domain B). In this case we can use Multicast transformations to load data to all domain. But we need to create connection string for all databases which may become complicated when the number of dataources are more (e.g., 50 connection instead of 3). To avoid this we can use For Each Loop container.
Follow the below steps:
1.      Create a table “dbo.Loop” and save the details of the data sources:





 
2.      Create the following variables as shown below:







3.      Create the following connection managers as shown below:
·        Sql Server connection LoadSourceDetails: To get details of databases to which data has to be loaded.
·         Sql Server connection Datasource: Connectuion manager configured with one of the destination datasources.
In this connection manager go to Expression Properties and config the below value:
"Provider=SQLNCLI10.1;Data Source="+ @[User::LoopServer] +";Persist Security Info=True;Password="+ @[User::Password] +";User ID="+ @[User::Username] +";Initial Catalog="+ @[User::LoopDB] +";"
























4.       Create a package as shown below:



5.       In Load DatasourceDetails config like below:


















SELECT        ServerDW, DatabaseDW, Username, Password
FROM            dbo.LOOP
WHERE        (IsActive = 1)


6.       In ResultSet map the User::LoadConnection variable:




 

7.       In For Each Loop container perform the below configurations:






















In Variable mappings:



















 
8.       In Data flow task create a simple flow tasks as shown below:



 
Now execute the package data will be loaded to all databases present in “dbo.Loop” table.

No comments:

Post a Comment