Click here to Skip to main content
16,005,734 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a mapping table. It contains following fields and Records.
SQL
ID     LocationID    DeviceID
1 	 1	      16,15,
3	 2	      17,15,
4	 3	      16,18,
5	 4	      15,17,

Only one location has differen devices. That's why I save it with comma seperator.
That is a correct method or not. Otherwise we save it in to different rows for every device id like following.
SQL
ID     LocationID    DeviceID
1	1	       16
2	1	       15
3	2	       17
4	2	       15
5	3	       16
6       3              18
7       4              15
8       4              17

What is the correct method? Anybody can suggest me?
Posted
Updated 16-Aug-13 1:56am
v3

1 solution

You should always put a single piece of data in a column, for ease of use and performance reasons.
 
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