How to store data with N columns

Posted by iconiK on Stack Overflow See other posts from Stack Overflow or by iconiK
Published on 2010-03-16T20:34:03Z Indexed on 2010/03/16 20:41 UTC
Read the original article Hit count: 207

Filed under:

I need a way to store an int for N columns. Basically what I have is this:

Armies:
ArmyID  - UINT
UnitCount1 - UINT
UnitCount2 - UINT
UnitCount3 - UINT
UnitCount4 - UINT
...

I can't possible add a column for each and every unit, so I need a fast way to store the number of each units in an army (you might have guesses it's for a game by now). Using XML is not an option as it will be dead slow.

© Stack Overflow or respective owner

Related posts about sql