Audit table to hold rowcount of several views

  • Guys:

    I have a table that will hold rowcounts as count(*) of several views.

    The table has PK and Timestamp as well as count value for each view.

    I need to watch the rate of rowcount increase as the month progresses in Month to Date Views.

    I do an insert of the rowcount value for the first value [works fine, with auto insertion of indentity PK and timestamp] Yeah you know whats coming. The rest of the values as insertions gets me many rows. The rest of the insertions as updates changes [updates] all the previous rowcount values for that particular view.

    Questions:

    1 Is it possible to make the timestamp just inserted a variable and somehow use that in some kind of WHERE situation

    OR

    Is there a much simpler [proper] way of doing this?

    Any help would really be appreciated..please

     

  • Post the DDL of the table and the SQL you're having problems with.

  • I'm not sure if I understood the problem correctly but the simplest solution I can think of is to add another audit table - with the PK of table1 as the foriegn key of the new table...then add a timestamp and increased_by column (or something similar) in the new table and subsequently add all inserts to the new table based on the PK of table1(I'm assuming the PK of the first table also includes the view_id etc..)

    hope this is what you were looking for...







    **ASCII stupid question, get a stupid ANSI !!!**

Viewing 3 posts - 1 through 2 (of 2 total)

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