|
-
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.
-
[QUOTE][i]Originally posted by sreddy [/i]
[B]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.
[/B][/QUOTE]
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.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
Jmodic,
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|