Transistor cross reference with pinout
The best way is to fine tune your search parameters so that the candidate list is reduced. With reduced tight list you really only need to look at data sheets till you find a suitable part....no need to look at every part data sheet. 

When considering that it is used as a relay driver do be careful to look at the driving circuit as well. There is a possibility that the component that you are looking to replace is a Darlington with a high current gain.