Am I living dangerously?

Results 1 to 2 of 2

Thread: Am I living dangerously?

  1. #1

    Default Am I living dangerously?

    Hi guys,<BR>How would it be possible to *safely and efficiently* group individual events or sessions within an sql database as part of handling individual sessions. I think I just confused myself!<BR><BR>As an example, our organisation hosts various training sessions over the year. Although these sessions are individual occurances..<BR><BR>Eg<BR>Internet Awareness Training<BR>12/09/04<BR>15/10/04<BR>28/11/04<BR><BR>They all make up a part of the Internet Awareness Training Program as a whole. What I have been doing is that when adding these events to my database, I look to what I have called the &#039;magic key&#039; (its simply a numerical field within sql server) grab the highest instance of it and add 1 to it.<BR><BR>Eg...<BR><BR>Cooking classes<BR>12/10/04<BR>14/10/04<BR>magic key = 34<BR><BR>I need to add and somehow group the next lot of entries...<BR><BR>Sewing classes<BR>02/04/04<BR>24/05/04<BR>11/09/04<BR><BR>The next lot of events that are added are grouped by a magic key value of 35. Understand? So basically, each entry is still unique, but grouped as part of the whole session or event.<BR><BR>I think that eventually I may come into some trouble using this method. Is there a safer way to group these individual events as a whole entity? I have found that this falls over when the magic key is null. <BR><BR>I know, im creating a mess, but its just so much fun!<BR><BR>John

  2. #2
    Join Date
    Dec 1969

    Default I think you're basically doing...

    ...the right thing - use a unique key to group records together. I would just add another table called "Sessions", where the first field is the "magic key", as you call it, and the second the name of the session. Then you can link those two tables together via this "magic key", and, hey presto, you&#039;ve got a relational database. :-)<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts