Discussion:
Primary key reindexing problem
(too old to reply)
dp
2005-07-19 14:45:48 UTC
Permalink
HI,

How to reindex a damaged primary key w/o killing the referential integrity?

REINDEX to my knowledge does not fix a damaged index so index usually is
better

so I use

INDEX ON <expr> TAG <tagname> CANDIDATE
ALTER TABLE <tablename> ADD PRIMARY KEY <keyexpr> TAG <tagname>

Only problem if the primary key was used in permanent relations in the DBC
and RI all the relations and RI in the DBC are destroyed after the INDEX ON
command.

So I guess I need some way to save the relations and RI info and then
restore it after indexing the file Granted all the Trigger commands are
still there and so is the RI code but next time I need to change the
database and RI I got to redo it all from scratch

Please advise

TIA
Cindy Winegarden
2005-07-21 02:42:17 UTC
Permalink
Hi DP,

Have a look at Stonefield Database Toolkit: http://www.stonefield.com/.
--
Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
***@msn.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden
Post by dp
HI,
How to reindex a damaged primary key w/o killing the referential integrity?
REINDEX to my knowledge does not fix a damaged index so index usually is
better
so I use
INDEX ON <expr> TAG <tagname> CANDIDATE
ALTER TABLE <tablename> ADD PRIMARY KEY <keyexpr> TAG <tagname>
Only problem if the primary key was used in permanent relations in the DBC
and RI all the relations and RI in the DBC are destroyed after the INDEX ON
command.
So I guess I need some way to save the relations and RI info and then
restore it after indexing the file Granted all the Trigger commands are
still there and so is the RI code but next time I need to change the
database and RI I got to redo it all from scratch
Please advise
TIA
Loading...