COUNTING NUMBER OF SELECTS MADE
table mytable {
id, data, hits
}
users view data from the table:
SELECT data FROM mytable WHERE id=1 --for example
SELECT data FROM mytable WHERE id=20 --for example
....
How do increment the hits column without replacing the above with the below?
update mytable SET hits=hits+1 WHERE id=1;SELECT data FROM mytable WHERE id=1
update mytable SET hits=hits+1 WHERE id=1;SELECT data FROM mytable WHERE id=20
....
I believe triggers can't be used as they only trigger on update/delete events.
I'm using sql server 2000 (latest patches) with asp
Thanks
Alex