February 28, 2013 at 9:09 am
hello World,
I have table with date and rowcount like below.
Time stamp Row Count
2013-02-28 10:53:50.283 1211
2013-02-28 11:53:50.283 1212
2013-02-28 12:53:50.283 1213
2013-02-28 13:53:50.283 1213
2013-02-28 14:53:50.283 1213
I am running the below command to retrive the information.
select getdate(), 'Row Count' = count(*) from dba_backuplocation
Now, i have to create a table with two columns Timestamp & Row count (say the table name is Rowcount_monitor) and insert the rowcount values every hour using
a sql server job. ( If we put my requiremnt is stored procedure and get that executed through job).
Requiremnt :
I have to monitor the table and compare the last three hours of rowconut and if the rowcount is same then i have send an
database mail saying rowcount did not change from last three hours. We can use the above table as example where the last three rowcount did not change. Also we have have to delete the records if they are two days old.
Can someone help on this immediately.
February 28, 2013 at 9:14 am
Duplicate post. Direct all replies to the original thread. http://www.sqlservercentral.com/Forums/Topic1425086-392-1.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply