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)
 finding data thats not there

Author  Topic 

superslip103
Starting Member

1 Post

Posted - 2006-04-07 : 04:38:51
Hi
I'm trying to find some entries in a table which aren't there, from a list I have. I know "NOT EXISTS" does not work. Here's what I want to do. Basically I need to check that a list of entries in my table exists before I do a mass update on the data. So I did a

SELECT * FROM AMHOST
WHERE hostname IN
(
'hostname1',
'hostname2',
.......
'hostname700'
);

This returned 697 results, which means that 3 entries are missing.
How Do I find out which 3 are missing from the table?

Please help!

Regards,
Rohit

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-07 : 04:49:04
Refer this
http://www.mindsdoor.net/SQLTsql/FindGapsInSequence.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-04-07 : 04:51:06
Use not in
SELECT * FROM AMHOST
WHERE hostname NOT IN
(
'hostname1',
'hostname2',
.......
'hostname700'
);
Go to Top of Page
   

- Advertisement -