Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 trigger to count the number or records inserted

Author  Topic 

arunsqladmin
Yak Posting Veteran

74 Posts

Posted - 2008-04-21 : 05:22:11
i want to check how many records are getting inserted into my database per day..can some one help in creating a trigger which gives the count

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-21 : 05:31:53
Per day?

You do not want a trigger for this. You need a job that runs every day and keep track of number of inserts previous day.
You don't tell us if there is a datetime column which defaults to insert time. If so, the query is simple.
If there is not a datetime column with information about insert time, you will need to build a auxilary table to calculate the difference in number of records for previous day with number of records recorded for the day before.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-24 : 04:35:08
Duplicate of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=101633

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -