Click here to Skip to main content
15,898,374 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi I have a table that I fill some fields of that,befor
BUT now I want fill another fields of that table with primary key

what do I do?

thanks
Posted
Comments
woutercx 21-Jul-12 15:01pm    
I read your question, but it confuses me, I don't exactly understand what your problem is... Maybe you can clarify?
- Do you want to copy the primary key of the row in the same row to another column? I don't see why you would want to do that..
- Do you want to copy the primary key of the row into another table?
veusk 21-Jul-12 15:12pm    
no.I want fill empty fields from records that before inserted some fields of them.
now I want fill empty fields by primary key
Member 7434378 21-Jul-12 15:13pm    
Or do you want to update a row with a primary key?
woutercx 21-Jul-12 15:16pm    
Maybe it will get clearer if you explain why you want to fill another field of that table with the primary key; what is your primary goal?
woutercx 21-Jul-12 15:17pm    
Or do you mean something with "default values"?

1 solution

Try this.
UPDATE "your table name" SET
"Table field" = "what you want to add
WHERE ["The product key field"] = "The product key"

e.g

UPDATE tblProduct SET
[Product Name] = 'Shoe box'
WHERE [Product ID] = 1

Say you set the Product ID as the product key, and the Product ID is 1 you have to specify "where Product ID = the product key".
 
Share this answer
 
Comments
veusk 21-Jul-12 15:37pm    
thank you very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900