473,795 Members | 3,175 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comparing data in two databases

4 New Member
Hi

We had a recent migration to a new server early this week (Tuesday). My database (and all the other files on the old server) were copied onto the new server. The old server is still up and running and some people inadvertantly entered data in the database on the old server over the past few days. I need to find out what was eroneously added to the database on the "old" server so I know what data I need to update in the real database on the "new" server.

I have a backup copy that I made on the "new" server immediately after the migration occurred. So, I can use that as the baseline database.

I also have a copy of the database on the "old" server on the date it was discovered that data was eroneously entered on the "old" server's database (Thursday).

How do I compare these 2 databases (tables) to see what data had been eroneously added to the old copy of the database?

(I don't know how to do VBA).

Thanks very much!!!!
Giff
Jan 12 '08 #1
1 1642
zaidlig
45 New Member
Hi

We had a recent migration to a new server early this week (Tuesday). My database (and all the other files on the old server) were copied onto the new server. The old server is still up and running and some people inadvertantly entered data in the database on the old server over the past few days. I need to find out what was eroneously added to the database on the "old" server so I know what data I need to update in the real database on the "new" server.

I have a backup copy that I made on the "new" server immediately after the migration occurred. So, I can use that as the baseline database.

I also have a copy of the database on the "old" server on the date it was discovered that data was eroneously entered on the "old" server's database (Thursday).

How do I compare these 2 databases (tables) to see what data had been eroneously added to the old copy of the database?

(I don't know how to do VBA).

Thanks very much!!!!
Giff
If this is a one time fix I would create a blank database. Link to the tables in the two different databases you want to compare. Create a select query that has both Old and New tables linked at the unique ID then right click the link line and choose to show all records in the Old table whether or not they exist in the New table. Then filter the New table ID field to "is Null". Now you should see all the records that exist in the Old table but not the New. At this point I would change the query from select to make table (called Missing) - just to review before appending the records. The query SQL should look somthing like this:

SELECT [Old Table].* INTO Missing
FROM [Old Table] LEFT JOIN [New Table] ON [Old Table].RecID = [New Table].RecID
WHERE ((([New Table].RecID) Is Null));

Once you are satisfied that the missing table is only missing records with no errors then create and run a simple Append query to the New table.
Jan 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1617
by: Jim Maas | last post by:
I'm taking up a new position and have never used sql before although use and code in lots of other languages. When doing a bit of survey I find many many versions of commercial and public versions of sql. Can anyone tell me if the syntax is generally similar or are they completely different. If I invest time learning mysql on XP or Linux will that be useful if I end up using something like Oracle later on? The only one I would avoid is...
0
1985
by: SQLServer007 | last post by:
25 more days until the "get it free" promotion runs out for xSQL Object (you can get it from http://www.x-sql.com) Here are just some of the great features packed in the product: - Compare SQL Server objects (databases, tables, views, stored procedures, user defined data functions etc.) accross servers. - view and print dependencies; - generate color coded scripts for any object in the database or many of them at once (many configurable...
22
24677
by: Bryan Guilliams | last post by:
I'm trying to come up with an elegant, simple way to compare two consecutive values from the same table. For instance: SELECT TOP 2 datavalues FROM myTable ORDER BY timestamp DESC That gives me the two latest values. I want to test the rate of change of these values. If the top row is a 50% increase over the row below it, I'll execute some special logic.
2
1224
by: Jorge Apolinário | last post by:
Hi, does anybody know a nice tool to automatically compare and show only the structural differences between two databases, this is, the differences in the columns of a table, constrains, data type, etc. Thanks J.A.
2
1669
by: Stephen | last post by:
I have to write a .Net application which can compare SQL Databases including things like: - DB structure, PK's, FK's, indexes and types of indexes i.e. should be able to detect if the same index has cascade set on one db and not on another, or unique on one and not the other, Constraints, Triggers, Stored procs, Users, Roles. I downloaded the SQL Data Compare 3.0 application 14 day trial and it seemed really good however does a bit more...
1
1313
by: Ryan | last post by:
Can anyone tell me how a program like this might work: http://www.red-gate.com/products/SQL_Data_Compare/index.htm I want to backup databases into a central repository but I only want the records that have changed for that day. This program seems to do it efficiently. Does Sql Server, Oracle, etc offer any sort of built in way of doing this via metadata or a similar mechanism? I want to be able to mirror databases in such a way that I...
2
6485
by: plmanikandan | last post by:
Hi, I would like to compare two sql server databases. I need to find the difference in the two database(i.e table, colums, data type) Is there any free utility available to compare sql server database I'm using sql server 2000. Help me out to compare databases Thanks & Regards, Mani
2
1518
by: deepu1 | last post by:
HI A school table is there in old and new data base, if i give school key as 001 (which is the column of school table) i need to compare old database school table "001 key" and new database school table "001 key" and if it is not matched it should be displayed. Please give me detailed dicription with example.and how to go and check two database if u give some data like schoolkey which is already present in the databases. thanks...
4
1852
by: ByB | last post by:
Hello, I would like to make a comparison between two databases in SQL server, to find differences between tables, procedures and so on. I have searched the web and found several softwares able to perform the task, but none able to compare a database with a backup otained from a SQL Server database, or between two backups. Is this possible ? Is there a software able to perform such comparison
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.