Trigger function when database field changes

Posted on 2011-09-22
Last Modified: 2013-11-27

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
Question by:johngrant_ks
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

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.

Expert Comment

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

Author Comment

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


Expert Comment

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 : 

Author Closing Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
import as existing maven project 3 42
Query in AngularJS 8 53
C# DataTable (in memory) vs SQL Lookups 4 38
Visual Studio 2015 auto inserted code 12 72
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

697 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