Link to home
Start Free TrialLog in
Avatar of Camnoc
CamnocFlag for Ireland

asked on

ASP PAGE TO COMPARE TABLES IN SQL DATABASE

Hi
I have two identical tables in my sql 2000 database BATCH and ONLINE. I need to compare the data in both tables and show any differences or additions. Unfortunately there is no primary key, only the complete row is unique
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

You can have to RecordSets & ConnectionStrings.
1 for each Database.
Have a Table with 2 Columns
And have the Rows set to populate Dynamically.

This way, all records will be displayed together at the same time.
And SHOULD be identical in value.
You can have then to Display are Asc = ID field (AutoNumber)

And if you are going to be editing 1 of the tables to make it match the other one.
Then just Hyperlink a popup window with the ID for the information to be displayed
And edit to match..

That would be the best way I would know to accomplish it.

Good Luck
Carrzkiss
Create a Select statement with a Full Outer join using all the columns will identify all the differences.
Can he do that will 2 different Database's?
Certainly.  But it appears from the question they are two tables in the same database: "I have two identical tables in my sql 2000 database BATCH and ONLINE."
it does dosn't it...
I think I need to take a break and rest my eyes.
I have mis-read so much stuff today....

Sorry for the confusin.

Carrzkiss
Avatar of Camnoc

ASKER

Hi
Yes, both of the tables are identical structure in the same database, however the online table is updated or appended to prior to being uploaded to the batch table. What I was hoping to do is compare both tables to show any changes made to the online table using asp , the catch is there are no real primary key. I am using Dreamweaver so both tables appear as recordsets connected to the database on my page
Then do as I suggested above.
Since we are dealing with the same database.
This is an example of what I am referring too.
http://ee.cffcs.com/Q_24265659/Q_24265659.asp
code
http://ee.cffcs.com/Q_24265659/Q_24265659.zip

This list both Tables in the same HTML Table.
With all their properties.

Let me know if this is what you are wanting, if now.
Then please supply a little more detail as to what you are wanting to accomplish.

Good Luck
Carrzkiss
>>the catch is there are no real primary key.<<
You do not need a primary key in order to do a join to compare.
Avatar of Camnoc

ASKER

What I need is to show the differences in Table a when compared to table b.
How would I write a full outer joint
try this.
I did created this, it checks to see if there is any difference between the 2 tables.

Good luck
Carrzkiss

 
SELECT Batch.ID, Batch.Field1, Batch.Field2, Batch.Field3
FROM Batch LEFT JOIN Online ON Batch.[ID] = Online.[ID]
WHERE (((Online.ID) Is Null));

Open in new window

:)
I did created this
Suppose to be:
I just created this.....  Typo's love em.

Carrzkiss
ASKER CERTIFIED SOLUTION
Avatar of Wayne Barron
Wayne Barron
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial