Click here to Skip to main content
15,885,366 members
Home / Discussions / Database
   

Database

 
AnswerRe: moving column in sql Pin
thatraja13-Jun-11 0:03
professionalthatraja13-Jun-11 0:03 
GeneralRe: moving column in sql Pin
Milad.Biroonvand13-Jun-11 7:53
Milad.Biroonvand13-Jun-11 7:53 
GeneralRe: moving column in sql Pin
Pete O'Hanlon13-Jun-11 9:01
mvePete O'Hanlon13-Jun-11 9:01 
QuestionGet Percentages Of Rows With Date In Them - Grouped Pin
Kevin Marois10-Jun-11 5:48
professionalKevin Marois10-Jun-11 5:48 
QuestionSQL Function problem Pin
Etienne_12310-Jun-11 0:07
Etienne_12310-Jun-11 0:07 
AnswerRe: SQL Function problem Pin
PIEBALDconsult10-Jun-11 2:47
mvePIEBALDconsult10-Jun-11 2:47 
AnswerRe: SQL Function problem Pin
Eddy Vluggen10-Jun-11 6:18
professionalEddy Vluggen10-Jun-11 6:18 
QuestionSQL with variable amounts of fields Pin
Expert Coming9-Jun-11 19:58
Expert Coming9-Jun-11 19:58 
I am working on a simple game where you take creatures into battle and they fight against each other. Everything is working fine minus figuring out the best way to store the results.

I want something similar to this data structure.

int ID (identity)
int AttackerID
int DefenderID
int AttackerCreatureID1
int AttackerCreatureID2
int AttackerCreatureID3
int DefenderCreatureID1
int DefenderCreatureID2
int DefenderCreatureID3

and then more for the creatures that died, ect

The problem is, I want the characters to be able to buy more battle slots and bring more into battle at a time. So, say they know can bring 5 creatures in, I don't want to have to make a bunch of new columns. Using XML this exercise would be pretty easy since you can just add a couple extra tags here and there whenever you want.

Like:
<AttackerCreatures>
<Creature>
<ID>12</ID>
</Creature>
<Creature>
<ID>12</ID>
</Creature>
<Creature>
<ID>12</ID>
</Creature>
</AttackerCreatures>


I've done lots of work with SQL before but never come across doing something like this with variable amounts of data column wise...

Any help would be awesome! Thanks ahead of time.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

AnswerRe: SQL with variable amounts of fields Pin
Roman_wolf10-Jun-11 3:44
Roman_wolf10-Jun-11 3:44 
GeneralRe: SQL with variable amounts of fields Pin
Expert Coming10-Jun-11 12:02
Expert Coming10-Jun-11 12:02 
AnswerRe: SQL with variable amounts of fields Pin
David Skelly12-Jun-11 22:38
David Skelly12-Jun-11 22:38 
QuestionSQL 2005 Pin
lyngocquy9-Jun-11 7:05
lyngocquy9-Jun-11 7:05 
AnswerRe: SQL 2005 Pin
jschell9-Jun-11 8:14
jschell9-Jun-11 8:14 
GeneralRe: SQL 2005 Pin
lyngocquy9-Jun-11 9:15
lyngocquy9-Jun-11 9:15 
GeneralRe: SQL 2005 Pin
Mycroft Holmes9-Jun-11 14:26
professionalMycroft Holmes9-Jun-11 14:26 
GeneralRe: SQL 2005 Pin
jschell10-Jun-11 12:38
jschell10-Jun-11 12:38 
AnswerRe: SQL 2005 Pin
AspDotNetDev9-Jun-11 8:16
protectorAspDotNetDev9-Jun-11 8:16 
AnswerRe: SQL 2005 Pin
Eddy Vluggen9-Jun-11 10:23
professionalEddy Vluggen9-Jun-11 10:23 
QuestionAccess AS SQL Front End Pin
mjackson119-Jun-11 5:03
mjackson119-Jun-11 5:03 
AnswerRe: Access AS SQL Front End Pin
Nagy Vilmos9-Jun-11 5:41
professionalNagy Vilmos9-Jun-11 5:41 
AnswerSample Code Pin
David Mujica9-Jun-11 7:56
David Mujica9-Jun-11 7:56 
JokeRe: Sample Code Pin
Mycroft Holmes9-Jun-11 14:17
professionalMycroft Holmes9-Jun-11 14:17 
GeneralRe: Sample Code Pin
mjackson119-Jun-11 18:16
mjackson119-Jun-11 18:16 
AnswerRe: Access AS SQL Front End Pin
Mycroft Holmes9-Jun-11 14:22
professionalMycroft Holmes9-Jun-11 14:22 
AnswerRe: Access AS SQL Front End Pin
jschell10-Jun-11 13:06
jschell10-Jun-11 13:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.