K
Kevin Spencer
Hi Guys,
I am new to this Access and database stuff, but I am giving it a go anyway.
Here's the problem.... I have a large text file that needs to be in a data
base. I have imported it into one table, it is 65 columns wide and has
650,000 records. Each record has a persons SSN and just there first and last
names.
But one person can appear multiple times, so I thought that I would start to
normalize this into additional tables. My first target was three fields,
SSN, FirstName and LastName. I ran a make table query that selected those
three field distinctly on SSN and made a new table. The plan was to have the
SSN as the primary key, allowing me to leave the SSN in the main table and
have the names with SSN in the newly created table. Here is the query I
used:
SELECT DISTINCT tblClaimsData.SSN, tblClaimsData.FIRSTNAME,
tblClaimsData.LASTNAME INTO tblPatient
FROM tblClaimsData;
This worked fine until I went into design view of the newly created table
and tried to set the SSN as a primary key, I received an error message
saying that duplicates existed! On further investigation I discovered that
even though there were no duplicate SSN's there were people with exactly the
same first and last name, but obviously with different SSN's. I though that
as long as there was one unique number in a record, it was unique. Am I
completely missing the point? The plan is to have the main table relate to
the second table on the SSN, eliminating the first name last name field
having to be stored in the original table.
Is there another way I can acheive this goal or am I in the right track?
Thanks for your help
Kevin
I am new to this Access and database stuff, but I am giving it a go anyway.
Here's the problem.... I have a large text file that needs to be in a data
base. I have imported it into one table, it is 65 columns wide and has
650,000 records. Each record has a persons SSN and just there first and last
names.
But one person can appear multiple times, so I thought that I would start to
normalize this into additional tables. My first target was three fields,
SSN, FirstName and LastName. I ran a make table query that selected those
three field distinctly on SSN and made a new table. The plan was to have the
SSN as the primary key, allowing me to leave the SSN in the main table and
have the names with SSN in the newly created table. Here is the query I
used:
SELECT DISTINCT tblClaimsData.SSN, tblClaimsData.FIRSTNAME,
tblClaimsData.LASTNAME INTO tblPatient
FROM tblClaimsData;
This worked fine until I went into design view of the newly created table
and tried to set the SSN as a primary key, I received an error message
saying that duplicates existed! On further investigation I discovered that
even though there were no duplicate SSN's there were people with exactly the
same first and last name, but obviously with different SSN's. I though that
as long as there was one unique number in a record, it was unique. Am I
completely missing the point? The plan is to have the main table relate to
the second table on the SSN, eliminating the first name last name field
having to be stored in the original table.
Is there another way I can acheive this goal or am I in the right track?
Thanks for your help
Kevin