Link to home
Start Free TrialLog in
Avatar of vvvlad42
vvvlad42Flag for Israel

asked on

Implementing promoting\demoting function like http://www.dellideastorm.com/

Hello Experts,

I would like to have your advice regarding this issue:
I want to implement promoting\demoting function like http://www.dellideastorm.com/.

I work with SQL 2005, C#, ASP.NET app

The simplest way I could think about to do it was 2 tables, one holds the "ideas" and has a key,
the other holds usernames and votes for each user by key.
The problem with this way is that the second table will grow fast and soon it will be very large.
Another problem is cleaning, how can I delete all the votes in the second table after the "idea" row was deleted from the first.
Is there any other way to keep this small and simple?

Please note I have only a basic knowledge of SQL and working with SQL server, so please make your explanations simple.
Thanks
Avatar of natoka
natoka
Flag of Austria image



2nd q: auto delete can be implemented using constraints on the foreign key(s)
e.g.
ALTER TABLE [vote] ADD
FOREIGN KEY
      (
            [IdeaID]
      ) REFERENCES [dbo].[idea] (
            [IdeaID]
      ) ON DELETE CASCADE  ON UPDATE CASCADE

ASKER CERTIFIED SOLUTION
Avatar of natoka
natoka
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial