Answer the question
In order to leave comments, you need to log in
How can you count how many times each row from a table has been read?
Good afternoon!
Situation:
There is a table with potentially redundant information. For example, a directory of world addresses.
Is it possible to calculate by some means that, for example, addresses in the USA, in the state of Texas, users have accessed,
but the addresses of Uruguay are of no interest to anyone and can be deleted from the table?
Answer the question
In order to leave comments, you need to log in
Actually a simple solution:
create spReadAddress @addr
as
select * from adrTable where address = @addr
if @@rowcount>0 update adrTable set requestCount=requestCount+1 where address = @addr
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question