471,091 Members | 1,519 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,091 software developers and data experts.

comparing data between two tables...

I would like to compare data across two tables. I have part
information in a table. I get a new set of information periodically.
I would like to compare my new info to my old info. I recognize that
doing a compare of every attribute of every part will take FOREVER. Is
there some way I can do a "diff" based on the columns that I care
about?

Thanks!

--gloria

Jul 23 '05 #1
2 1832

"gloria" <gu******@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I would like to compare data across two tables. I have part
information in a table. I get a new set of information periodically.
I would like to compare my new info to my old info. I recognize that
doing a compare of every attribute of every part will take FOREVER. Is
there some way I can do a "diff" based on the columns that I care
about?

Thanks!

--gloria


No idea - your desciption isn't very clear (to me), so I suggest you post
some CREATE TABLE and INSERT statements to show exactly what you want:

http://www.aspfaq.com/etiquette.asp?id=5006

But in general, you can do something like this:

select *
from dbo.MyTable1 t1 join dbo.MyTable2 t2
on t1.KeyColumn = t2.KeyColumn
where t1.col1 <> t2.col1
or t1.col2 <> t2.col2
or ... /* other columns here */

Simon
Jul 23 '05 #2
Simon,

Your general code snippet tells me what I need to do. Thanks.

--gloria

ps. Thanks for the etiquette tip. I will do this in future. :)

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

41 posts views Thread by Odd-R. | last post: by
4 posts views Thread by osmethod | last post: by
2 posts views Thread by Shum | last post: by
8 posts views Thread by irek.szczesniak | last post: by
5 posts views Thread by Franck | last post: by

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.