Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Executing Java Pgm using Trigger

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-04-22 : 07:33:10
Sivaram writes "Dear SQL Team,
I want to run a java program on insertion of a record in a table in SQL Server database. The database can be ver 7 or 2K.
Can you please send me a sample on this.
My requirement (briefly explained)
On every insertion, a trigger shd be fired, which will call a java pgm which will come and pick up the record from the table.
If you have any other alternative, then pls let me know. It can be something like, a trigger calling a stored procedure, and in turn the stored procedure calling a batch file, in which the command to exectute the java pgm will be written.
Expecting a quick reply.
Thanks in advance.
Sivaram.G"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-04-22 : 07:44:58
Well, the main question is, why a Java program? What does it do?

It is better to avoid running executeable programs from within a SQL Server process unless they are absolutely necessary. Even then, it's better to avoid running them from triggers in SQL Server. If you need a trigger to export rows to a file or something like that, it's better to have the trigger put those rows into a staging table, and then create a scheduled job that runs periodically to write that staging table out to disk, then clear it. Writing data out to disk every time trigger fires will usually cause performance problems unless the table is updated very infrequently.

Also, are you migrating something from Oracle? If you are, you should consider re-examining the methods you're using for this process, it's unlikely transferring only the database and leaving the rest as is will give you the best performance.

Go to Top of Page
   

- Advertisement -