Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 381
  • Last Modified:

Trigger function when database field changes

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
johngrant_ks
Asked:
johngrant_ks
1 Solution
 
yogsoftCommented:
You can evaluate Sql Dependency with windows service. where windows service will execute appropriate function based on the chages in database.
0
 
kswathiCommented:
can you be bit clear on  the kind of function to execute i.e. at DB level / UI level.
0
 
johngrant_ksAuthor Commented:
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
 
harshgandhi18Commented:
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
 
johngrant_ksAuthor Commented:
Was the best clue to help me move forward with the final solution
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now