Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

index question

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hi

I want to drop an index, which a foreign key using it too. Is there any affect? Actually I need to change a value of a field and this field is indexed, as the result, I have to drop it first, change the data and then recreate the index after. Should I recreate the foreign key too?

Thanks
 
hello,

if you mean the foreign key constraint... i would drop it... followed by the index... update the data, recreate the index, then add the foreign key constraint back...

hth,
q.
 
Thanks

I think I would do per your suggestion, however, the problem lies at the primary key, not the index even I already drop the index. Should I drop the primary key first? I don't know if it is a good idea or not but sound like there are too many links to this primary key.
what should I do?
 
hello,

do a sp_helpconstraint on the table... it should give you a list of all the foreign key constraints... you need to drop all of them... to change the data of your primary key... then re-add them after you reindex...

you know that you that will have referential integrity problems after you do this? your foreign key cannot exist without a primary key...

hth,
q.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top