Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Table Comparison in a SQL Query

Author  Topic 

halbichmi
Starting Member

3 Posts

Posted - 2004-08-25 : 11:46:59
Hi everyone!

I am looking for some info on how to build an SQL query or SQL stored procedure that will look at two tables and compare the data and rows to see if they are identicle and then dropped the newest one.

Does anyone have any suggestions or have done something like this before?

Thanks for your input(s)!


Marion

X002548
Not Just a Number

15586 Posts

Posted - 2004-08-25 : 12:25:23
What do you mean by newest one?

What do you mean by identical?

Can you post the ddl of the tables?

Are they in the same database?

Brett

8-)
Go to Top of Page

halbichmi
Starting Member

3 Posts

Posted - 2004-08-25 : 12:30:12
What I need is two different procedures, one to compare existing data tables to one another. And one to check new data to the previous day and not complete the load process.

I am not allowed to post the tables since I work for the govt., but what I mean is, that I load data every day....and sometimes there is not a difference in the data between the two days. So therefore, I need to compare the new data to the day before's and if it is the same (i.e., number of records and data matches identically) do not load the new data into a new table.

Thanks



Marion
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-08-25 : 12:59:54
Check this out....

http://weblogs.sqlteam.com/brettk/archive/2004/04/23/1281.aspx



Brett

8-)
Go to Top of Page

halbichmi
Starting Member

3 Posts

Posted - 2004-08-25 : 13:04:33
Okay, I will look at it and see if I can work with it.

Thanks!



Marion
Go to Top of Page
   

- Advertisement -