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)

Move Data from SQL Server to another in Informatica 1

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 2

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 Informatica definitions. So, go to the Source menu and select the Import from Database.. option.

Move Data from SQL Server to another in Informatica 3

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.

Move Data from SQL Server to another in Informatica 4

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 5

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.

Move Data from SQL Server to another in Informatica 6

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

Move Data from SQL Server to another in Informatica 7

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.

Move Data from SQL Server to another in Informatica 8

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.

Move Data from SQL Server to another in Informatica 9

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.

Move Data from SQL Server to another in Informatica 11

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

Move Data from SQL Server to another in Informatica 12

It creates a Workflow for you

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

Move Data from SQL Server to another in Informatica 14

Name it as s_move_data_from_sql_to_SQL.

Move Data from SQL Server to another in Informatica 15

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.

Move Data from SQL Server to another in Informatica 16

Please link the Start Task and the Session Task.

Move Data from SQL Server to another in Informatica 17

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.

Move Data from SQL Server to another in Informatica 18

$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 19

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

Move Data from SQL Server to another in Informatica 20

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

Move Data from SQL Server to another in Informatica 21

We are changing the 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 Informatica 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.

Move Data from SQL Server to another in Informatica 24