How do I write a point-in-time record to another table?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sans_spam@yahoo.com

    How do I write a point-in-time record to another table?

    I'm writing a classic ASP application that records all logging of user
    logins on our support site. The logging is a rolling window of how many
    people have logged in for a given month, i.e. tracked by a 'lastlogin'
    field so the tracking is done in a date range. So, for the month of
    January I would record lastlogin dates between January 1 and January
    31. My question is this...on the last day of the month (example being
    Janauary)at 23:59:59PM I want to write the total number of users that
    had a lastlogin date within the month of January and write that total
    number to another table so I have a point-in-time figure for January
    logins and how many users logged in in the month of January. How do I
    do that? How can I have the sql server dynamically check the last day
    of each month at 23:59:59PM and then run that query to obtain the total
    numbers users that logged in and then record that value to another
    table?? Do I use a SQL Job to do that?
    Any help would be greatly appreciated! Thanks!

  • Erland Sommarskog

    #2
    Re: How do I write a point-in-time record to another table?

    (sans_spam@yaho o.com) writes:[color=blue]
    > I'm writing a classic ASP application that records all logging of user
    > logins on our support site. The logging is a rolling window of how many
    > people have logged in for a given month, i.e. tracked by a 'lastlogin'
    > field so the tracking is done in a date range. So, for the month of
    > January I would record lastlogin dates between January 1 and January
    > 31. My question is this...on the last day of the month (example being
    > Janauary)at 23:59:59PM I want to write the total number of users that
    > had a lastlogin date within the month of January and write that total
    > number to another table so I have a point-in-time figure for January
    > logins and how many users logged in in the month of January. How do I
    > do that? How can I have the sql server dynamically check the last day
    > of each month at 23:59:59PM and then run that query to obtain the total
    > numbers users that logged in and then record that value to another
    > table?? Do I use a SQL Job to do that?[/color]

    Yes, an Agent job that is set up to run at 23:59:59 at the last day
    of the month is something you easily can set up from Enterprise Manager.



    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Books Online for SQL Server SP3 at
    Transform your business with a unified data platform. SQL Server 2019 comes with Apache Spark and Hadoop Distributed File System (HDFS) for intelligence over all your data.

    Comment

    Working...