Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a table named details. It has 3 fields vendorID,itemID and ItemName. I need to add more than one vendor for a particular item. For example:
vendor ID:1,2,3
ItemID:1
ItemName:abc
I need to store values in my table in the above model.
Please help me.
Posted
Updated 11-Apr-14 2:35am
v2

1 solution

Don't.
It's a very bad idea, and you will have to do a heck of a lot of work to use the information later - SQL can't store more than one numeric value in a column, so you would have to store it as a commas separated string: which means it doesn't relate directly to the actual vendors at all.
Instead, add another table which relates ItemID to VendorID, and add three rows to that.
 
Share this answer
 

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