I need to compare 2 databases and accordingly have to write the logs.
Now suppose I ahve 2 DBs, d1 and d2.
I have written function in which I am connecting to both the DBs. Also I am able to execute queries like select * from table1 from both the DBs. Suppose 10 records are fetched through both the databases. Now would like to know how would I compare row by row each data from 2 tables. ANY CODE SNIPPET WILL HELP ME.
You can write the results of the queries from the databases to different excel sheets and then use excel object model to retrieve data and do the comparison. Having data in an excel sheet will help you in debugging your comparison code
and also be there for future reference.
Done this for a previous project but sorry no code snippet.
Thanks for your reply. But I want to do the comparison using Recordset object. After comparison logs will be written in excel sheet having both the records written with pass or fail values. So in this way I am writing in excel sheet with comparison results.
So now I would like to know how I can compare the recordset variables for each column and row.
Freeware is fine. But we do not allow any freeware and also as we have QTP and we have to use QTP for DB comparison. We know we have same tables that are migrated to different database. So just want to know how feasible is DB comparison using QTP. As I am planning to compare DB row by row and write the logs in excel file at runtime.