• Craig Farrell (8/4/2011)


    Ninja's_RGR'us (8/3/2011)


    Ninja's_RGR'us (8/2/2011)


    UPDATE dbo.AnalysisLog SET @Count = Count = Count + 1 WHERE ...

    Nevermind that part, I had missed the fact that there's 1 row per date where there's action on the page.

    We both did. I was inspired to believe it was a single row first generated when the first click of the page was performed, primarily because of this quote from the article:

    When a web page is accessed, Query #2 runs first, looking to see if that particular article has ever been viewed before or not. If not, then another query (which is not in the top 10 list) is run to create a new record where clicks are tracked in a table;

    Brad, can you clarify please?

    Based on a Profiler trace I took, here is what appears to happen. Query 1 runs first, and if it doesn't find a record for page that is viewed, then an INSERT is performed into the table so that its views can be tracked. This INSERT query is not in the 10 ten, so I did not list it. If Query 1 does find a record, then Query 2 runs, updating the record for the page that is viewed. The developer of this code was a contractor and did not document eactly what happens or why, so I have had to infer what happens based on what I see in the trace.

    Brad M. McGehee
    DBA