T31 - Automate Database Migration. Transfer data from one Database to other |
Task Description |
Query the database, get the data and transfer that data to other database.
T31.htm |
| Solutions |
 |
Open Task Editor to create a new task
- Click on New->Task Editor
|

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4
|
 |
Connect to the database
- Using 'Database:Connect' command, specify the connection string to connect to the source Database with Session Name, Default. Screenshot0
Connect to '<database connection string> ' Session: 'Default'. Screenshot1
|
 |
Specify a SQL Query to get the data from the database
- Double click Database command from the Application category, select SQL Query Option and specify a Select SQL Statement using 'Default' session. Execute SQL Statement: Select * From OrderMaster Session: 'Default'. Screenshot2
|
 |
Connect to the target database
- Insert second Database:Connect command to connect to the target database where you want to transfer data using 'S1' session.
|
 |
Transfer the data
- Double click Loop command under ‘Conditions/Loops’ command category and selecting "Each row in a SQL Query Dataset" option. You can Loop through each row of the result returned by the query with 'Default' session using this Loop option.
- Inside the Loop Block, specify Insert query to insert records in target database using Database:Insert/Update/Delete command. Screenshot3
Note: To access values of different columns in the dataset use the index 1,2,3 etc with the System Variable $Dataset Column$.
|
 |
How to run the task:
- In case you do not have Automation Anywhere installed, please download and install it from, http://www.automationanywhere.com/download/freeTrial.htm
- Save T31.atmn under location, My Documents\Automation Anywhere\Automation Anywhere\My Tasks
- Save MyTargetDB.csv and MyDB.mdb under C:\.
- Launch Automation Anywhere and from Task List select T31.atmn and click on RUN button to run the task.
|
|
| When you run this task, it reads the data from source database and inserts them one by one into the target database. |
|
 |
| We started using this product to copy data from legacy system to new system. Now we use it just to do about anything automated. Countless hours saved. Thank you guys. |
- Jack Greenberg
|
| Read Customer Testimonies >> |
|