Subject | Re: Index error |
---|---|
Author | Michael Vilhelmsen |
Post date | 2004-02-02T22:39:48Z |
Hi All
By experimenting with my backup file I have found out which table is
being annoying.
I can restore my DB without indexes and afterwards activate all index
except the one in question (and those related to this field through
foreign keys).
So far so good.
The field which is PK is a varchar (30).
If I do a
Select Navn, Count(*) from Table Group By Navn
I don't get any dub.
But if I go through them manually (which I can do, since there is
only some 100 records) I see at least 3 dub.
If I deleted those 3 dub. records, then I can active my PK.
But after this I have another table on which I would like to make a
new FK.
This I can't do. because this table table contains values that are
not present in the master table.
By doing this
select
storgrp_detail.stoerrelse_navn
from storgrp_detail
where
(not storgrp_detail.stoerrelse_navn in (select stoerrelser.navn
from stoerrelser))
I get 4 values.
but those 4 values are present in the DB in the master table.
Right now I now more or less what to do, if the original DB at my
client server goes down, but I would like to:
1.
Find out how to fix this from my backup file.
2.
What to do with the original running DB, so I can take a backup that
will actually work (without corrupting my DB).
So any help is appreciated.
Regards and thanks so far.
Michael
By experimenting with my backup file I have found out which table is
being annoying.
I can restore my DB without indexes and afterwards activate all index
except the one in question (and those related to this field through
foreign keys).
So far so good.
The field which is PK is a varchar (30).
If I do a
Select Navn, Count(*) from Table Group By Navn
I don't get any dub.
But if I go through them manually (which I can do, since there is
only some 100 records) I see at least 3 dub.
If I deleted those 3 dub. records, then I can active my PK.
But after this I have another table on which I would like to make a
new FK.
This I can't do. because this table table contains values that are
not present in the master table.
By doing this
select
storgrp_detail.stoerrelse_navn
from storgrp_detail
where
(not storgrp_detail.stoerrelse_navn in (select stoerrelser.navn
from stoerrelser))
I get 4 values.
but those 4 values are present in the DB in the master table.
Right now I now more or less what to do, if the original DB at my
client server goes down, but I would like to:
1.
Find out how to fix this from my backup file.
2.
What to do with the original running DB, so I can take a backup that
will actually work (without corrupting my DB).
So any help is appreciated.
Regards and thanks so far.
Michael