Get date of last change in table?

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Get date of last change in table?

    How can I find out the date/time of the last change to the data within
    a specific MSSQL table using ASP? How can I find out the last change to
    the structure? How can I find out the last access?

    Are these things logged by default and what do I write to grab the
    values? Do I need to turn on some logging and if so does it cause
    performance problems?

    Help very much appreciated!

    --
    Google Blogoscoped
    [url]http://blog.outer-court.com[/url]
    Philipp Lenssen Guest

  2. Similar Questions and Discussions

    1. Date Change
      hi i am using asp vbscript and when i submit to a database the date changes the days and month around? does any one have any ideas on how to solve...
    2. Change Date Format
      I have a date being entered into a textbox in a dd/mm/yy format, however I need to be able to change this format to a yyyy/mm/dd in order to pass the...
    3. change modified date?
      Howdy: Is there a perl module that can change the modified date of a file in Windows (or, Linux)? On my Linux box, I'm testing the 'touch -m'...
    4. Date of last change in a certain field
      Hi, I'd like to generate the present date in one field, when another field changes. Could anybody tell me how to do that? Thanx in advance! --...
    5. Stop date change
      How do i stop users from changing the date backwards on XP -
  3. #2

    Default Re: Get date of last change in table?

    Philipp Lenssen wrote:
    > How can I find out the date/time of the last change to the data within
    > a specific MSSQL table using ASP?
    Add a datetime column to the table and create an UPDATE trigger to update it
    with GetDate().
    > How can I find out the last change
    > to the structure?
    There is no builtin way to do this. You will need to maintain this value
    yourself somewhere as part of your source control system.

    If you restrict schema changes to CREATE statements, then sysobjects
    contains a crdate column which is supposed to contain the date the object
    was created. But ALTER statements will not update that column.

    > How can I find out the last access?
    You mean access as in SELECT statements? You can't. Oh, I suppose you could
    restrict access to the tables and require the use of stored procedures
    which log every use, but what's the point? This would bog down the
    performance of your application.
    >
    > Are these things logged by default
    No, with the proviso that all transactions that involve data modification
    are logged in the transaction log. Third-party programs such as Lumigent's
    Log Explorer and Entegra expose the log but that really doesn't help you
    with getting the information via ASP.

    HTH,
    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [MVP] Guest

  4. #3

    Default Re: Get date of last change in table?

    SQL Server doesn't track this information, you will have to do so yourself
    or with the help of a 3rd party product. Certainly, any operational
    activities you add are going to cost in terms of performance. Only you can
    test it out and decide whether the performance implications are non-existent
    or not acceptable.

    [url]http://www.aspfaq.com/2448[/url]
    [url]http://www.aspfaq.com/2495[/url]
    [url]http://www.aspfaq.com/2496[/url]
    [url]http://www.aspfaq.com/2499[/url]

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)




    "Philipp Lenssen" <info@outer-court.com> wrote in message
    news:2ibl92Fl81huU1@uni-berlin.de...
    > How can I find out the date/time of the last change to the data within
    > a specific MSSQL table using ASP? How can I find out the last change to
    > the structure? How can I find out the last access?
    >
    > Are these things logged by default and what do I write to grab the
    > values? Do I need to turn on some logging and if so does it cause
    > performance problems?
    >
    > Help very much appreciated!
    >
    > --
    > Google Blogoscoped
    > [url]http://blog.outer-court.com[/url]

    Aaron [SQL Server MVP] Guest

  5. #4

    Default Re: Get date of last change in table?

    You could add a LastChangedDate to each record or create a table that
    stores the last changed date for each table. Either way you'll need to
    update these with each data add/update/delete you make to the table
    somehow.

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Consultant
    [url]http://www.Bullschmidt.com[/url]
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Devdex [url]http://www.devdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139