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
 Other Forums
 Other Topics
 Search within a search

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-30 : 08:51:01
Carl writes "Here's the deal:

1. Two tables - First table is "Contact". It contains contact info, like
Contact_Name, Address, etc., etc, and also Password

2. Second table is "Main". it contains "Make, Model, Size, etc., etc., and
also Password.

All records in both tables are keyed to that Password. The entire
operation in both tables keys all identities, privileges, etc. to that
password.

Each record contains a Password in the "Main" table. That Password,
therefore, is duplicated many times in the Main table. There is only one
record with that same Password in the "Contact" Table.

Looks like I need some type or recursive search feature (search within a
search?) to accomplish my normalization. I want many records with the same
password keyed to the one contact record with that same password.

And here is the kicker. In the search I do not want the password to be a
part of the apparent search criteria, but obviously it has to be keyed to
the "Contact" record, somehow, as in with that password. In other words, I
want to search for a record in the Main Table, containing Make and Model,
which also happens to contain a password, (but it's not shown to the user.)
I want each instance of a found record to join the
Contact info from the Contact table. That Contact Table record contains
that same password as that instance of the Main table record. So, I need
some kind of search, which obtains the password from each record found and
then joins that found record with the Contact table entry, having that same
password.

That way each Main table record does not have to waste database space with
Contact info duplicated as many times as their are records in the Main
table.

So, I am attempting to take each found record from the Main table search,
and combine it with its related Contact table record. Password is never
part of the user defined search, but each Main table record needs to be
aware of its own Password, so it can join itself with the Contact table
info with the identical Password."
   

- Advertisement -