Missing Primary Key Constraint

dcbmichaels

Member
On table F42199 I am missing the Primary Key constraint as well as the indexes. What is the proper procedure to recreate both the primary key constraint and the indexes for this table? Can anyone help... I have looked into the R9698712 UBE... but i keep getting errors when trying to run INVALID DATA SOURCE ... but it does not prompt me for any datasource. Any help here would be much appreciated

WIN2K, SQL2K, ERP 8 SP22

DCBM
 
Get the table into your default project in OMW, select design and in the Table Operations tab, select the Generate Indexes button.
 
thanks... but i tried this first... i recieve an error CREATE INDEX FAILED... i think this is because the primary key constraints are not present

DCBM
 
Check the JDE.LOG on the machine generating the index. It should give you some sort of clue as to why the generation was not successful.

DeRay Scholz
 
As Deray stated, check your logs - the first thing this process does (I believe) is to drop all indexes - it then creates the primary key before it creates any of the other indexes.

If you have dups or nulls in this table this is where it would fail.

You might want to look at the table and see if any of the primary fields are null first - if that fails, run a count query against the key fields and see if you have dups.

Fix those problems and you should be able to create the indexes.
 
I have found a lot of duplicates in this table... making it unable to reindex... is there an easy way to clean up the dups? or will i have to go one by one.... there are about 1000 dups... in this table alone. Thanks for all your help guys....

DCBM
 
DCBM,

First make sure that you really have dups - the primary key on this table includes last updated date and time in addition to the key fields from the F4211. FWIW, this is the only index I have on this table.

You may end up having to do a select distinct into a temp table, truncate the F42199 and then insert the records back from the temp table before you'll be able to index it.

MS SQL can be a real PITA to attempt to delete a dupicate record when there is no key to go on. Don't know what SQL server you are running...

Good Luck!

Dave
 
Back
Top