Updating a field that is a part of the composite primary key

S

sameervalluri

I have a table that has a composite primary key
Using an update query is it possible to modify the value of one of the
fields that is part of the composite primary key ?

Sample table :

TaskID - Number
SubTaskID - Number
StepID - Number
StepDesc - Text


The Primary key consists of 3 fields : TaskID, SubTaskID, StepID
Sample data :

TaskID SubTaskID StepID StepDesc

1 1 1 Step No One
1 1 2 Step No Two
1 1 3 Step No Three
1 1 4 Step No Four
1 1 5 Step No Five

Say, the third record is to be deleted. Is it possible for the StepID
to be reordered to fill in the gap.
i.e. the update query would have the following output:

1 1 1 Step No One
1 1 2 Step No Two
1 1 3 Step No Four
1 1 4 Step No Five

Is it poosible to do this with an Update query
 
G

Guest

You can modify the value of a primary key field whether or not it is a
composite primary key as long as the new value does not cause the entire key
to be a duplicate of an existing record.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top