Solved

Trigger function when database field changes

Posted on 2011-09-22
5
375 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
[X]
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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

691 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