Hi,
If I have a table "Foo" with an index on "id", does the index become invalid if I truncate the table? If so, why is that? If not, is the index still valid?
Thanks in advance,
(much appreciated)
Tracy
Printable View
Hi,
If I have a table "Foo" with an index on "id", does the index become invalid if I truncate the table? If so, why is that? If not, is the index still valid?
Thanks in advance,
(much appreciated)
Tracy
Index is VALID, if you truncate the table, But constraints have to be disabled on the table in order to use TRUNCATE on 'foo'.
You must disable the constraint before truncating the table.
No, not constraintson table 'foo', only foreign keys from other tables referencing the table to be truncated! You can leave any constraint that is defined on the truncating table intact.Quote:
Originally posted by sreddy
Index is VALID, if you truncate the table, But constraints have to be disabled on the table in order to use TRUNCATE on 'foo'.
You must disable the constraint before truncating the table.
What if table 'foo' is a parent table of enabled referential integrity constraint ? To truncate table 'foo' one must disable referential integrity constraint. Am I right ?
Thats what jmodic said ;-)
Now I got it. We meant the same. Its just english we are discussing about. I meant the same. Constraints on table 'foo' meant referencing tables. I would have taken little care in phrasing my sentence saying referencing tables. I will watch out next time when write something on Referential Integrity.
sorry for confusion.thx for pointing out...