Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Send SMS from a trigger Expand / Collapse
Author
Message
Posted Sunday, September 23, 2007 6:21 PM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, April 10, 2014 9:33 AM
Points: 14, Visits: 22
Comments posted to this topic are about the item Send SMS from a trigger


Got SQL Server? Manage It with Siccolo
Post #401763
Posted Tuesday, November 06, 2007 11:58 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 06, 2007 11:54 PM
Points: 1, Visits: 7
I found your article quite interesting int approach to using SQL svr as a broadcast point. Thanx.
Post #419449
Posted Sunday, November 25, 2007 9:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, November 25, 2007 9:28 AM
Points: 1, Visits: 1
Hi. I'm from VietNam. I've read your article and very excited about it. But when I do like you, I can't send a message to a mobiphone or e-mail. I think your SMS provider's rules not suitable to my country but I can't solve that problem. Can you help me? Phone number in my country have format like 840958149760. 84 is the code of my country. 095 is the code of the provider. 8149760 is the phone number. :). Can you contact with me throught my e-mail (kimxuyen.it@gmail.com) or yahooID: kimxuyenit? Thanks!
Post #425492
Posted Monday, July 21, 2008 5:36 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, July 21, 2008 5:23 AM
Points: 118, Visits: 3
Need to be pretty careful with this trigger.

Consider if the call to exec master.xp_sendMail .... fails.

This is a trigger - an error will cause an automatic rollback of the transaction in which the trigger was fired. Not only will the email/sms not be send but also the action which caused it to be raised - i.e. the insert into the table will not happen. If this insert was called from e.g. a stored proc then whatever was in there would also roll back.

I had a very similar problem many moons ago with a USERS table for a web site that had a trigger to send a rgistration email - lo and behold if exchange falls over or we can't connect to it then not only do they not receive their registration email but they also don't get registered on the site - i.e. no row appears in the USERS table. Very dangerous.



Post #537577
Posted Monday, July 21, 2008 5:38 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, July 21, 2008 5:23 AM
Points: 118, Visits: 3
Oh and btw SQL 2005's database mail is now asynchronous therefore we no longer have the same issue in 2005.


Post #537578
Posted Friday, September 12, 2008 12:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 12, 2008 12:05 AM
Points: 1, Visits: 0
.... i m an pl/sql developer
working for a coperative banks

now the bank pepoles want to send sms to their customer when they do some transaction
whether it is credited or debited

.. bank is using a oracle database to store the information
about all transaction and using window OS
after every transaction it insert a row in a dotr010 (transaction table)

sir i had developed a standalone software to send sms usning AT commands in VB 6.0

but sir it is not automatically trigger a sms to customer this utility not send sms untill it is not run by bank pepoles

i need your help
my banking software is completely
window based

i need ur help to get know
1. how to communicate GSM modem through oracle (procedure,pl/sql)
2. how the sms is triggered when one row is inserted in a transaction tabel
3. and how to maintain log file

this all only by using oracle no interface

thanks for kind time
i hope you pepole reply soon
i need it

regard
atul
Post #568269
Posted Friday, September 12, 2008 7:07 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 6:12 AM
Points: 10,910, Visits: 12,553
I just want to mention that I agree with MackamMagic, that you need to be very careful when doing something like this in a trigger, in fact I recommend against it, although as MackamMagic also mentions this is not as much an issue with SQL Server 2005. If you need to do any action outside the database I recommend queuing the data using a trigger and have a job or windows service that does the action.

The other thing is that are you sure you only want to send an email or SMS out when only 1 row is updated? At the least shouldn't someone be notified that a mass update was done?




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #568455
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse