December 29, 2004 at 8:50 am
Hi,
I need to compare data in the same table from two different databases.
AdeptSQL Diff does a good job but does not have capabilities to export
the results. I need to present the comparison results to the user.
I am trying to write a stored procedure to do a comparison
and store the results in a third table
but it might take time.
Has anybody seen maybe a script to do the comparison?
Thanks,
Robert
December 29, 2004 at 11:45 am
have you tried RedGate SQL Compare?
A.J.
DBA with an attitude
December 29, 2004 at 11:50 am
I did try Red-Gate.
I couldn't save the results in CSV or any other format.
After I played with it for an hour I gave up.
December 30, 2004 at 10:35 am
What exacatly you mean with compare? Do you want to show to the user doubble records or a total of maching records (like same client code or ID)?
For example finding duplicated Codes in the two tables:
SELECT DB1.dbo.Table1.Code, DB1.dbo.Table1.ID, DB1.dbo.Table1.Name
FROM DB1.dbo.Table1
WHERE DB1.dbo.Table1.Code In (SELECT DB2.dbo.Code FROM DB2.dbo.Table1 GROUP BY DB2.dbo.Code HAVING Count(*)>1 )
ORDER BY DB1.dbo.Table1.Code
Enter this statement as Stored Procedure in any of the two DB's. You can query any tables from any DB like the one above.
I hope this helpes.
December 30, 2004 at 10:42 am
Sorry, the select statement I just sent before is to find duplicated records in one table; was stupid.
But the basic what I mean is that you can query tables from different DB's without any problem.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy