I got 3 items (hits, num_of_people, degree) to update while the people click 3 different buttons
And as you know, the SQL query are almost the same, just like:
update Mytable set XX = XX + 1 where ID = @ID
What I want to ask is that:
- Should I write 3 different stored procedures,
or -
Should I set a parameter that distinguishes these 3 process, maybe something like:
if @flag = 'hits' begin ... end
Thanks so much!
Write three different stored procs.
Firstly this is a more robust design over time – for instance, later when yours needs change slightly you can modify only the appropriate stored proc.