Move Data from SQL Server to another in Informatica

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)

Source Table

And the Destination table is Duplicate Cust. As you can see, it is an Empty table

Destination 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 repository service by providing the Admin Console Username and password you specified while installing 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 Informatica definitions. So, go to the Source menu and select the Import from Database.. option.

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 ODBC Connection article.

From the below screenshot, you can observe that we are selecting the Customers table from our SQL Tutorial database.

Import Table to store the data

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

Move Data from SQL Server to another in Informatica Source analyzer

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.

Import Target Table from Database

Please select the ODBC connection that will connect the Informatica with the SQLTest Database. To create a new one, please refer to the ODBC Connection article.

Here, we are selecting the DeplicateCust table from our SQLTest database. You can refer to Create Target table using Source Definition

Select the Database Table

Step 3: Create Mapping to move data from one Database to another in Informatica

To create a new mapping, Please navigate to the Mappings menu in and select the Create.. option.

Create Mapping to Move Data from SQL Server to another in Informatica

It will open the Mapping Name window to write a unique name for this mapping. Let me rename and click the OK button.

Mapping Name

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.

Move Data from SQL Server to another in Informatica 10

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.

Create a Workflow to Move Data from SQL Server to another in Informatica

It opens the Create Workflow window. Please provide the unique name (wf_move_from_SQL_to_SQL) and leave the default settings.

Workflow Name

It creates a Workflow for you

Workflow Designer 13

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:

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.

Create Session to Move Data from SQL Server to another in Informatica

Name it as s_move_data_from_sql_to_SQL.

Session Task Name

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.

Select Move Data from SQL Server to another in Informatica Mapping

Please link the Start Task and the Session Task.

Connect Start and 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.

Move Data from SQL Server to another in Informatica Target Connection Value

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 Move Data from SQL Server to another in Informatica Target Load Type to Normal.

Move Data from SQL Server to another in Informatica 22

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 PowerCenter Workflow monitor opened to monitor the workflow. From the below screenshot, see our workflow executed without any errors.

Move Data from SQL Server to another in Informatica 23

Let us open the SQL Server Management Studio to check whether we successfully transfer the data from a source or not.

Destination Table