473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to notify?

Hi,
I have a table in MS SQL -
NotifyTBL
==============
ID int Primary Key
SearchID int
OfferID int

this table is populated when a user Insert values in OffersTBL. A trigger
does this automatically. What I want to do is every 30 min to check if there
is a new records in NotifyTBL and if there are I would like to send e-mail
message to users. How could be accomplished that?

Thank you !

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.8.2004 a.
Nov 16 '05 #1
3 1399
One way would be to keep track of the Max(ID) in the table, if the value
changes after 30 mins you know that new values have been inserted, you
can retrieve the new rows by using
select * from NotifyTBL where ID > lastMaxID

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

Viktor Popov wrote:
Hi,
I have a table in MS SQL -
NotifyTBL
==============
ID int Primary Key
SearchID int
OfferID int

this table is populated when a user Insert values in OffersTBL. A trigger
does this automatically. What I want to do is every 30 min to check if there
is a new records in NotifyTBL and if there are I would like to send e-mail
message to users. How could be accomplished that?

Thank you !

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.8.2004 a.

Nov 16 '05 #2
Thanks for the reply!
I would like to ask how to send the e-mails- by MS SQL SERVER in some other
way?

"Sijin Joseph" <si***************@hotmail.com> wrote in message
news:#n**************@tk2msftngp13.phx.gbl...
One way would be to keep track of the Max(ID) in the table, if the value
changes after 30 mins you know that new values have been inserted, you
can retrieve the new rows by using
select * from NotifyTBL where ID > lastMaxID

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

Viktor Popov wrote:
Hi,
I have a table in MS SQL -
NotifyTBL
==============
ID int Primary Key
SearchID int
OfferID int

this table is populated when a user Insert values in OffersTBL. A trigger does this automatically. What I want to do is every 30 min to check if there is a new records in NotifyTBL and if there are I would like to send e-mail message to users. How could be accomplished that?

Thank you !

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.8.2004 a.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.8.2004 ã.
Nov 16 '05 #3
awk
You could let SQL Server do the work for you by
creating a Datetime field in NotifyTBL and setting
it's default value to getdate() (the current date and time).
Then build a scheduled Job to run a sql script every half
hour and use sql server to send the mail notification.

Awk

"Viktor Popov" <vi****@yahoo.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
Hi,
I have a table in MS SQL -
NotifyTBL
==============
ID int Primary Key
SearchID int
OfferID int

this table is populated when a user Insert values in OffersTBL. A trigger
does this automatically. What I want to do is every 30 min to check if there is a new records in NotifyTBL and if there are I would like to send e-mail
message to users. How could be accomplished that?

Thank you !

Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 27.8.2004 a.

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alessandro GARDICH | last post by:
Hi to all I have problem with NOTIFY/LISTEN ... I'm writing a C++ application with libpqxx, I thought was a problem of the lib but I try also with a C program using libpq with the same result,...
4
by: Joe Lester | last post by:
I'm using PostgreSQL 7.4.1. I have 140 clients connected on average using libpq. When one client sends "NOTIFY timeclock;" to the server all 140 clients are listening for it. After receiving a...
3
by: Frank van Vugt | last post by:
L.S. Either the docs or I are missing something.... While using libpq I noticed that listen/notify calls were being converted to lowercase. A further look showed that the listen/notify calls...
5
by: Ted Shab | last post by:
Hi, I'm trying to come up with a relatively simple multi-master replication solution. This is for multiple databases that need to be discreet, and change relatively infrequently (10-30 updates...
3
by: Mark Denardo | last post by:
Does anyone have any good VB.NET example code that shows how to use the NOTIFY option using the mciSendString API and then handle the return value. The only examples I can find show the VB way...
5
by: cozsmin | last post by:
hello , as u know wait() and notify() will not thow an exception if the method that calls them has the lock , or esle i misundrestood java :P this is the code that throws (unwanted) ...
1
by: namrataa | last post by:
i have a notify icon for our media player developed in wpf. included files are notify.cs,notify.resx,notify.designer.cs. i have also added a class file called app.cs . now the problem is how...
0
by: namrataa | last post by:
i have the following code for my notify.cs file using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Text; ...
5
by: Peter | last post by:
I have a webpage which creates reports, a report can take few seconds or several minutes to create. This webpage calls a web service which in turn does a remoting call to a windows service and the...
2
by: greyradio | last post by:
I've recently have been given an assignment to do and it seems that notify() does notify() any of the waiting threads. The project entails 10 commuters and two different toll booths. The EZPass booth...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.