Ok you've convinced me I think I will use that approach. Alright so I've set up some test tables
Users
------------
ID int identity PK
Name nvarchar(80)
Email nvarchar(100)
Password binary(16)
Achievements
------------
ID int identity PK
Name nvarchar(60)
Desc nvarchar(200)
RequiredLevel int
UserAchievements
----------------
UserId int
AchievmentId int
DateReceived datetime
AchievementProgress
-------------------
UserId int
AchievementId int
Progress int
Required int
Updated datetime.
2 final questions, the first one is how to select these properly. Ideally on my page I would have ALL the achievements that are available shown. Those which have not been achieved will be sort of faded or something like that. Also those which require a certain progress (3 out of 5 etc) will display the progress. So basically I need the result set to display
Name Desc Progress DateAchieved Updated
Acheivment1 blahblahblah 1/1 22/6/2011 22/6/2011
Acheivment2 blahblahblah 5/5 22/6/2011 22/6/2011
Acheivment3 blahblahblah 3/5 NULL 22/6/2011
Acheivment4 blahblahblah 0/5 NULL NULL
The name and description should be from 'Achievements' table, progress and updated from 'AchievementProgress' table and DateAchieved from the 'UserAchievments' table. But I can't get the 0/5 for progress of Acheivment4 because the row would not exist, or would I pre-create the ancillary table rows?
Second question is should I use a trigger to insert the UserAchievements row, for example when an 'AchievementProgress' row is updated, check to see if the Progress has reached the required level and if it has, insert a new row? Or would it be better to run this inside my proc for updating the AchievementProgress row?
Sorry for the long post, final questions I promise