Solved

Trigger function when database field changes

Posted on 2011-09-22
5
369 Views
Last Modified: 2013-11-27
Hi

I need to create web application as a preference or a windows application if there is no other way.

i want to trigger a function in a web application when a piece of data changes in database without a user initiating the function, i have no idea where start on this

Any help of where to look would be much appreciated, have already considered triggers in a database but this only solves half the problem i need a function to be fired in either a web or windows application if possible.

Any help would be appreciated
0
Comment
Question by:johngrant_ks
5 Comments
 
LVL 2

Accepted Solution

by:
yogsoft earned 500 total points
ID: 36579851
You can evaluate Sql Dependency with windows service. where windows service will execute appropriate function based on the chages in database.
0
 
LVL 6

Expert Comment

by:kswathi
ID: 36579860
can you be bit clear on  the kind of function to execute i.e. at DB level / UI level.
0
 

Author Comment

by:johngrant_ks
ID: 36584272
What is a happening is people are sending a text messages to a third party provider, the provider sends those txt messages to me using http protocols.

The provider expects a response back within 2 seconds that the message has been received successfully.

So i can’t do a lot of processing of information during the exchange between the provider and myself. So i need to send the success response back ASAP.

Then at a later time process the other components which can take a great amount of time like send out 10000 txt messages and organize the database.

So you could look at it this way, when the 10000th txt message is received i change a value in a database table and that triggers the function (Or some other way) to execute the function that sends out the 10000 txt messages and organizes the rest of the data in the database.

And i need to keep these process separate so that the txt message that im sending out can happen at the same time that i receiving txt messages from the provider.

Let me know if I can clarify it more

Thanks
john
0
 
LVL 1

Expert Comment

by:harshgandhi18
ID: 36585479
You can create a trigger "After Update trigger" and in the same trigger you can perform the logic you want to perform.

You can even execute the DB Function (either Table Value or Scaler Value) within the same Trigger.

I am not sure what function you do want to execute after the update. But you can definitely create the trigger and it will initiate the job you want to perform.

You can refer to : http://msdn.microsoft.com/en-us/library/ms189799.aspx 
0
 

Author Closing Comment

by:johngrant_ks
ID: 36818925
Was the best clue to help me move forward with the final solution
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now