Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 30, 2012 03:40 PM by wavemaster
Dec 30, 2012 01:55 PM|LINK
I am keeping track of how many times people watch a subset of my data.
Currently, at the appropriate time I read what the counter is, increment and then update the counter.
There must be a way to do this in one fell swoop.
Here is my attempt:
db.Execute("UPDATE Trips SET Views=Views ++ WHERE TripID=@1", TripID);
tried a few variations, no luck.
There must be a way to do this, elegantly.
Dec 30, 2012 02:37 PM|LINK
db.Execute("UPDATE Trips SET Views=Views +1 WHERE TripID=@1", TripID);
the ++ operator is not implemented in SQL_Server
Dec 30, 2012 03:40 PM|LINK