Eric writes "I am importing a list of email addresses and aliased email addresses from an old unix system. The flatfile from unix is set up as follows:alias: email_address
Both alias and email_address are valid addresses to send to for a given user. The user may have multiple aliases and the chain of aliases can be of any length. Take the following for example:
robert.jones: rjonesrjones: bob.jonesbjones: bob.jonesbob.jones: bobj
With the above (fake) subset of the alias table, all addresses are all aliases for the same user.I need to be able to do the following: Given any valid email address, return all valid email addresses for the user. So, if I am given robert.jones, I need returned back to me rjones, bob.jones, bobj, bjones, and robert.jones. I have created a table names aliases and have given it an identity field (pk), an alias field, and an address field. This is imported into SQL server using DTS. I tried several queries but have not gotten what I want. It looks like it may require recursion which I have never attempted in the SQL world. Any ideas?"