Click to See Complete Forum and Search --> : Database to initialize another application procedure


rutu
May 5th, 2007, 01:53 AM
hi,
I am working on a project in which we have two applications. Both the applications talking with the database server. My requirement is when enver i make a new entry through one application that will be updated in the database and I need something in trigger or something which will call a procedure of second application and that data will be available to the second application. I dont know whether it is possible or not. Can any one guide me on this please.

Thanks
Ashwini

TheCPUWizard
May 5th, 2007, 02:02 AM
Well; it would help if you gave some details like the EXACT Database Server you are using, What language your applications are developed in, etc....

[If I only had a dollar for every time someone expected people here to read minds....] :sick:

rutu
May 5th, 2007, 02:26 AM
hi,
i am using MySQL database and VC++ 6.0.

hspc
May 5th, 2007, 03:43 AM
Do both applications connect to the same database?
What version of MySQL do you use?

rutu
May 5th, 2007, 04:49 AM
ya both the applications connecting to the same database and i am using MySQL 4.1. But the problem is two applications having no link. Only the link is through Database , thet is both connecting to the same database. Is it possible through anyway to initialize a procedure of second application from the database whenever database is updated through the first application?

hspc
May 5th, 2007, 05:02 AM
You can make a timer in the 2nd application to poll the database for changes.
other ways can be complicated, for example you can make both applications connect to a server application that makes the updates, and notify client applications using sockets.

TheCPUWizard
May 5th, 2007, 07:20 AM
If you are going to "poll for changes". I strongly recommend you create a distinct table that contains summary information about what has changed in a distinct manner. This way the "second" application only has to look at one table, and do minimal updating... [Timestamping and indexed field in the other tables is often applied also...]

rutu
May 5th, 2007, 08:15 AM
But any way the second application is going to look into the database for any changes. Is it not possible to write a trigger which will bw fired and after the trigger is fired the output will be sent to 2nd application or procedure which will update the database, and send the output to 2nd application.

TheCPUWizard
May 5th, 2007, 08:39 AM
There may be ways in MySql. This can definately be done in SQLServer (2000 or 2005). Especially nice functionallity in '05.

rutu
May 5th, 2007, 08:46 AM
Can you pleaase provide me any link which describes how to do it in SQL Server 2005?

hspc
May 5th, 2007, 09:52 AM
I think TheCPUWizard means SQL Server Notification services (http://www.microsoft.com/sql/technologies/notification/default.mspx) Which you can find more info about in msdn (http://msdn2.microsoft.com/en-us/sql/aa336315.aspx)

TheCPUWizard
May 5th, 2007, 10:06 AM
Notification Services are a viable alternative... :)

I was referring more to: http://blogs.msdn.com/sqlclr/archive/2005/11/21/495438.aspx