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
 Transact-SQL (2000)
 Table row count w/notification

Author  Topic 

justjohno
Starting Member

23 Posts

Posted - 2007-08-19 : 02:59:46
Hello,

I'm trying to send notification if a table reaches a certain number of rows. For example, if table >15 rows send email.

Im thinking of the count or exist function. If anybody could help it would be great.

John O

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-08-19 : 10:27:50
create a job that check periodicaly if the table reaches the limit and send the mail from there.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

justjohno
Starting Member

23 Posts

Posted - 2007-08-19 : 11:04:14
Spirit1

Thanks for the advice, that was my thought and understand what you're saying but need a little more information on how to perform the actual checking of the table.

John O
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-08-19 : 11:09:00
if (select count(*) from yourTable) > 15
begin
... send mail...
end

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

justjohno
Starting Member

23 Posts

Posted - 2007-08-19 : 12:53:34
spirit1

Thank you very much...that is the help I needed.

John O
Go to Top of Page
   

- Advertisement -