In this article, we will show how to Move Data from SQL Server to another in Informatica with an example. For this Informatica Move Data from SQL Server to another example, we are going to use the below show data (Customers table)
And the Destination table is Duplicate Cust. As you can see, it is an Empty table
Move Data from SQL Server to another in Informatica
Before we start configuring the Informatica to Move Data from one SQL Server Database to another database. First, connect to Informatica repository service by providing the Informatica Admin Console Username and password you specified while installing the Informatica Server.
Step 1: Create an Informatica Move Data from SQL Server to another Source Definition
Once you connected successfully, Please navigate to Source Analyzer to define your Sources. As we said before, we are using the Customers table from the SQL Server database as our source definitions. So, go to the Source menu and select the Import from Database.. option.
Please select the ODBC connection that will connect the Informatica with the SQL Tutorial database. To create a new one, please refer to the Informatica ODBC Connection article.
From the below screenshot, you can observe that we are selecting the Customers table from our SQL Tutorial database.
It will add the table definition (Column Names and appropriate data types) inside our workspace under the Source Analyzer. Please refer Database Source to understand the creation of source definition
Step 2: Create an Informatica Move Data from SQL Server to another Target Definition
Please navigate to Target Designer to define the Target. In this example, we are using the existing SQL table as our target definition. So, go to the Targets menu and select the Import from Database.. option as shown below.
Please select the ODBC connection that will connect the Informatica with the SQLTest Database. To create a new one, please refer to the Informatica ODBC Connection article.
Here, we are selecting the DeplicateCust table from our SQLTest database. You can refer to Create Target table using Source Definition
Step 3: Create Mapping to move data from one Database to another
To create a new mapping, Please navigate to the Mappings menu in and select the Create.. option.
It will open the Mapping Name window to write a unique name for this mapping. Let me write m_move_data_from_SQL_to_sql and click the OK button.
Drag and drop the Customer’s source definitions from Sources folder to the mapping designer. Once you drag the source, the Power Center designer automatically creates the Source Qualifier Transformation for you.
Next, Drag and drop the target definition from the Targets folder to the mapping designer. Next, connect the source qualifier with the target definition using the Autolink.. option.
Let us Save, and Validate the mapping by going to Mapping Menu and select the Validate option.
Step 4: Create a Workflow to move data from one SQL Server to another
After we finish creating the Mapping, we have to create the workflow for it. Power Center Workflow manager provides two approaches to create a workflow.
In this example, we will create the Workflow manually. To do so, Please navigate to Workflows Menu and select the Create option.
It opens the Create Workflow window. Please provide the unique name (wf_move_from_SQL_to_SQL) and leave the default settings.
It creates a Workflow for you
Once we created the Informatica Move Data from SQL Server to another workflow, our next step is to create a session task for our mapping.
Step 4(a): Create Session to move data from one Database to another Database
There are two types of sessions in Informatica:
For this Informatica Move Data from SQL Server to another example, we created a Non-reusable Session. To create Non-reusable Session, Please navigate to Tasks Menu and select the Create option as shown below.
Name it as s_move_data_from_sql_to_SQL.
Once you click on the Create button, a new window called Mappings opened. Here you have to select the mapping (m_move_data_from_SQL_to_sql) that you want to associate with this session.
Please link the Start Task and the Session Task.
Double click on the Session task will open the Edit Tasks window. Within Properties Tab, we have two common properties that we have to configure for the relational databases.
$Source connection value: This property will store the relational source information in the $Source variable. So, click on the Arrow we marked below, and select the SQL Tutorial as the source information.
$Target connection value: This property will store the relational target information in the $Target variable. So, click on the Arrow we marked below, and select the SQL Test target as the Target information.
Within the mappings tab, we have to configure the Source, target Connections, and some common properties. First, let us configure the source connections by clicking on the SQ_Customers source present in the Sources folder.
Within the Connections, click on the Arrow button beside the Relational type, and use the Connection variable that we created in our previous step, i.e., $Source
Now, we have to configure the Target Connection. So, let us configure the target connection by clicking on the DuplicateCust present in the Targets folder.
Within the Connections, click on the Arrow button beside the Relational type, and use the Connection variable that we created earlier, i.e., $Target
We are changing the Target Load Type to Normal.
Next, navigate to Workflows Menu and select the Validate option to validate the Workflow. Now, Let me start the Workflow. To do so, navigate to the Workflows menu and select the Start Workflow option.
Once you select the Start Workflow option, the Informatica PowerCenter Workflow monitor opened to monitor the workflow. From the below screenshot, see our workflow executed without any errors.
Let us open the SQL Server Management Studio to check whether we successfully transfer the data from a source or not.