comparing two lists

R

rbutch

hey guys, i need some help on an approach.
i need to compare, two different lists.
one will be pulled from a dataset and could have as much as 2500 varchar employee numbers in it.
the other will have the same data, but might be missing some of those same numbers.
what's the best way to compare the two lists, or group or array and find who's missing from the second list?
thanks
rik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
G

Guest

The basic process is:

1. Pull both sets of information
2. Sort both sets of information in the same order
3. Run through both sets with one set of info as master and the other as
slave. Always advance until slave is equal to or greater than master.

If one is in a file, consider dumping the database info to a file (using
BCP, or your own code) and then use StreamReaders to rip through each file.
The BCPed file will already be sorted by employee ID, so you will just have
to make sure the non-database file is sorted in the same order.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
R

rbutch

thanks for the feedback, i actually figured it out in sql using an equijoin and a subquery.
so i end up fetching all the employees from the larger list who are NOT IN(then my subquery to the smaller list)
but, i did have some fun with the streamreader which i've got some other uses for anyway.
thanks again for the tip
rik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top