query required

  • I need a query to get the number of user count based on the hits on the database on a day wise .

  • You need to post the table schemas involved, some sample input data and desired output using the sample data

    Gerald Britton, Pluralsight courses

  • schema is dbo and table is CT_NKT and database is DGIM

    The output needs as

    Number of hits date

  • To see how many times a table is touched you could use sys.dm_db_index_usage_stats. This can show how many times the table is updated or referenced in a query. You need to understand how this DMV works and then build some kind of a daily data collection and delta calculator to see the hits per day. It won't give you a list of users, just total number of times a table is touched.

  • I didn't need the database schema I need the table schema that is the CREATE TABLE statement. also please post some sample data and the desired up with using that sample data

    Gerald Britton, Pluralsight courses

  • g.britton (3/20/2015)


    I didn't need the database schema I need the table schema that is the CREATE TABLE statement. also please post some sample data and the desired up with using that sample data

    I think you need to read the question again.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • ramyours2003 (3/20/2015)


    I need a query to get the number of user count based on the hits on the database on a day wise .

    Quick thought, use Audit for this.

    😎

  • ramyours2003 (3/20/2015)


    I need a query to get the number of user count based on the hits on the database on a day wise .

    Does your database have a log table? Where are you storing the hits information? If you are referring to a website then google analytics shd help

    “If your actions inspire others to dream more, learn more, do more and become more, you are a leader.” -- John Quincy Adams

  • Rename the table and see how many users complain. 🙂

    Or use an extended event trace. Either way, it's not something you want to be counting 24x7. I assume you just need to occasionally gather user based usage statistics.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply