Solved

Trigger function when database field changes

Posted on 2011-09-22
5
367 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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 …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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.

744 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

11 Experts available now in Live!

Get 1:1 Help Now