473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

PK mess...

KT
It's nasty when you need to take somebody's work and modify
it...that's what I am doing.

This database i am working on has a main form and a subform. There
isn't any primary key nor relationship defined. The subform is linked
to the main form with the AccountNumber field (using Link child
field/Link master field). However, since it's not set as PK key, some
of the records today has blank AccountNumber.

I would like to add an AutoNumber field to these table as the PK. Is
there suggestions as to how I could clean up this mess???

Thanks a lot!
Nov 13 '05 #1
2 1216
ka****@rocketmail.com (KT) wrote in message news:<fe***********************@posting.google.com >...
It's nasty when you need to take somebody's work and modify
it...that's what I am doing.

This database i am working on has a main form and a subform. There
isn't any primary key nor relationship defined. The subform is linked
to the main form with the AccountNumber field (using Link child
field/Link master field). However, since it's not set as PK key, some
of the records today has blank AccountNumber.

I would like to add an AutoNumber field to these table as the PK. Is
there suggestions as to how I could clean up this mess???

Thanks a lot!

Maybe create a new table structure with a PK field in it (Autonumber)
Append the UNIQUE values from the current parent table.
Create a new child table structure with the new numeric PK and the old
text pseudo PK or whatever. join the two tables together (probably an
outer join) and generate all the child records with the new FK, but
NOT as autonumber - you want that value to go into the FK (so it'll be
LONG instead of AutoIncrement/Unique). Append and you should be ready
to go.

And don't try this on a live copy. that could get you into some
serious hot water... and fast.
Nov 13 '05 #2
In message <fe***********************@posting.google.com>, KT
<ka****@rocketmail.com> writes
It's nasty when you need to take somebody's work and modify
it...that's what I am doing.

This database i am working on has a main form and a subform. There
isn't any primary key nor relationship defined. The subform is linked
to the main form with the AccountNumber field (using Link child
field/Link master field). However, since it's not set as PK key, some
of the records today has blank AccountNumber.

I would like to add an AutoNumber field to these table as the PK. Is
there suggestions as to how I could clean up this mess???


Adding an AutoNumber won't fix the problem, just hide it. As a short
term fix you could create a new dummy account just for those orphaned
records, and set their AccountNumber to the matching value. Then alter
the table to make AccountNumber required, so that new records can't be
created without one.

The real problem is that you have a number of orphan records. Whoever is
responsible for the data needs to tell you what account number to assign
to each and every one of those records or give you authority to delete
them. It's possible that when the records were entered without an
account they simply disappeared, and whoever entered the data would then
simply enter it again, hopefully getting it right the second time. If
that happened then you should find that for each bogus record there is a
record that has the same data, but with a valid AccountNumber.

This appears to be a management problem not just a technical one, and
you shouldn't just be looking for a technological fix. The data is
corrupt and it's up to the owners of the data to fix it. If the data in
this system is financial then someone somewhere has to sign a piece of
paper that tells you what to do with the orphaned data, and they should
be prepared to show that paper to the auditors.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan V. | last post by:
Why when I add a bulleted list to a page does it mess up the Navigation list on the left? These are the two pages: (one has a bulleted list the other does not and works fine) ...
0
by: Will Honea | last post by:
I've been handed a mess of related data in the form of multiple spead sheets. Each set of data contains part or parts of the what is needed in the final database but there is no common usable...
17
by: C# Learner | last post by:
Is there a way to avoid the following mess? int i = 0; if (someString != null) { try { i = Int32.Parse(someString); } catch (FormatException) { } }
2
by: Craig | last post by:
I'm a C# forms programmer, don't know alot about web programming, and I've been thrown on a web project and it seems like a mess, I wanted some direction. The current web site is hosted on unix...
2
by: M. Simioni | last post by:
Hi, the webserver is a HP ProLiant DL380 G3 1GB RAM Dual U320 SCSI COMPAQ Smart Array 5i + Battery Pack installed N°2 (RAID 1) COMPAQ BD072863B2 - 72.8GB Ultra320, 10K Hot-pluggable, 1"...
19
by: santosh | last post by:
Hi all, In the following program I allocate a block of pointers to type char, initialised to zero. I then point each of those pointers to a block of allocated memory of fixed size (33 bytes). A...
7
by: DMina | last post by:
Hello people, I have an AIX system with the following characteristics: - OS Level : AIX 5.3.0.0 - DB2 Level : DB21085I Instance "dwinst1" uses "64" bits and DB2 code release "SQL08023"...
12
by: damjan | last post by:
This may look like a silly question to someone, but the more I try to understand Unicode the more lost I feel. To say that I am not a beginner C++ programmer, only had no need to delve into...
1
by: TomB | last post by:
Hello, The new design of my band's website is finally coming together. I think it looks very nifty (especially the menu) and it perfectly validates. Hooray. I still have a problem though with...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.