Thursday, March 22, 2012

Comparing data from two identical databases

Since splitting a large SQL 7.0 database off into several smaller but structurally identical ones based on year, I've discovered that there is some data missing from the new database
I need to find out what data in the old database is not in the new database, and insert it into the new database
Can anyone help
Thanks in advance
John SteenTake a look at SQLCompare from Red Gate.
www.sqlcompare.com
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"John Steen" <anonymous@.discussions.microsoft.com> wrote in message
news:C350518B-4F74-4E97-B5E1-0B45C4797001@.microsoft.com...
> Since splitting a large SQL 7.0 database off into several smaller but
structurally identical ones based on year, I've discovered that there is
some data missing from the new database.
> I need to find out what data in the old database is not in the new
database, and insert it into the new database.
> Can anyone help?
> Thanks in advance.
> John Steen|||check out www.dbghost.com
>--Original Message--
>Since splitting a large SQL 7.0 database off into several
smaller but structurally identical ones based on year,
I've discovered that there is some data missing from the
new database.
>I need to find out what data in the old database is not
in the new database, and insert it into the new database.
>Can anyone help?
>Thanks in advance.
>John Steen
>.
>|||Thanks, Mark. I may look into it that tool later, but I need a query ASAP that will identify the data in the old DB that's missing from the new DB, and then insert that data.
I've tried this, but it returns 0 rows, and I know there is discrepancy:
SELECT * FROM oldDB.dbo.table1
WHERE NOT EXISTS (SELECT * from newDB.dbo.table1)
My query skills are minimal, so I don't know what's wrong with this query. But I would appreciate any and all help. I'm desperate!
Thanks,
John
-- mark baekdal wrote: --
check out www.dbghost.com
>--Original Message--
>Since splitting a large SQL 7.0 database off into several
smaller but structurally identical ones based on year,
I've discovered that there is some data missing from the
new database.
>>I need to find out what data in the old database is not
in the new database, and insert it into the new database.
>>Can anyone help?
>>Thanks in advance.
>>John Steen
>.
>

No comments:

Post a Comment