December 8, 2009 at 6:12 pm
I have a table in SQL 2005 which I want to compare against a DB2 table. What will be the best way to do this in a VB .net Program? I am currently opening two different connections and trying to read them and compare one by one. but this is very slow and taking a long time..
Any help is much appreciated...
Thanks,
Nikhil
December 9, 2009 at 6:56 am
Are you comparing the schemas or the data?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 9, 2009 at 9:30 am
Like Jack said comparing two different database can be anything.Schema,data or some time change in structure. I assume you might be capturing the difference and reporting the user. If so just do them at the database level (stored procedure ) and get the result out.
December 10, 2009 at 8:06 am
if you want to compare all the data, I would use SSIS to migrate the entire table to a scratch database in sql server and then use an automated tool such as Data Diff from ApexSQL (which has a command line interface so you can automate it).
Disclaimer: I have a close relationship with Apex, use their products and recommend them to my clients. Also, if you care to you can mention TheSQLGuru sent you you will get a discount and my daughter will get a few coins for her college fund.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 10, 2009 at 8:17 am
As Sqlguru suggested SSIS is very handy tool for synchronization. It is very efficient and fast. I have tried it personally.
(dont know why his daughter needs funding as he is guru for all us!!!)
ta
December 13, 2009 at 2:32 am
I've had decent results using MS Access to compare data from different sources. Link tables to each of the databases, then use Access queries to do the comparisons. As long as you have ODBC DSN's defined for each source, it's easy to do.
December 13, 2009 at 10:49 pm
I wanted to do a Data match up between two tables. Think of it just like a VLOOKUP in excel. I will try the Access approach and see what comes up. I can't go for a new Database or temp tables in SQL. There are some resource limitation in our Production environment. :crying:
Thank you friends for prompt replies
December 14, 2009 at 11:00 pm
Guys,
I tried the MS-Access approach and it seems that this is not going to work all well. When I run query after designing the Link Tables, the query retruns error "data mismatch in criteria expression" I double checked the columns and it seems that none of the columns need a casting.
Any suggestion or advise is really welcome.
Thanks,
Nikhil
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply