January 26, 2011 at 8:48 am
Hi. I would like to send email notification to all@domain.com when user logins = 28.
Email: Please close inactive sessions
Table 'Token' lists users to which a token has been issued.
Can anyone advise on this.
Kind Regards,
Phil.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
January 26, 2011 at 9:28 am
Run your query to get a count, and if @@rowcount >= 28, then sp_send_dbmail
January 26, 2011 at 9:41 am
Thanks for the response. Still use a trigger?
Kind Regards,
Phil.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
January 26, 2011 at 9:48 am
Where would the trigger be placed ? How would it work ?
My suggestion requires a scheduled job to run every 'x' minutes.
The right solution depends on your specific requirements. I just gave the first idea I thought of.
January 26, 2011 at 9:52 am
Hi. That should work. My query is quite simple SELECT COUNT(UserId) FROM Table. How would I implement the email being triggered to a specific email address.
Kind Regards,
Phil.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
January 26, 2011 at 10:28 am
Assuming you have email configured, then recipients is just one of the parameters. BOL has all the specs.
January 27, 2011 at 9:02 am
Thanks.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply