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!

Changing Primary Key

Status
Not open for further replies.

forwardslash

IS-IT--Management
May 23, 2002
18
US
Hello:)

I need to change the primary key in the DB. Is the a way to do it without deleting the data. At this point it would not be a probelm since this is a new project.

Any idea's anyone could give me would be great.

Thanks

Michele
 
In theory: no (primary key values should never change).
In practice: Yes:
You can create an new unique index on a new field and use that as your new primary key. If you have relationships from other tables to the table you modified, you have to modify the referring tables as well.
If all references and relations are finished, you can delete the old ones.

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top