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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-04-02 : 06:33:23
|
| Scott writes "SQL Server 2000Windows 2000 ServerIIS 5.0Is there a way to call either an ASP or JSP script from a table trigger? We'd like to regenerate some script includes on our web site when values change in our look-up tables. We can schedule them to run on a periodic schedule, but it would be much more eloquent if we could get the triggers to fire off the script.I read on your site about the sp_OACreate procedure that opens COM objects, but I didn’t find anything specific to scripts.Thanks in advance - Go ahead and rip me if I've overlooked something basic...Scott Jacob" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-04-02 : 06:44:00
|
quote: Thanks in advance - Go ahead and rip me if I've overlooked something basic...
OK... NEVER run ASP or JSP code from a SQL Server trigger. Avoid placing any code of that type in a trigger because it will hold execution of the trigger until it completes. Web access is not bulletproof enough to guarantee safe and clean execution, and you'll bring your SQL Server to its knees if you incorporate that kind of code in a trigger.You can always place look-up data in an external file, either XML or HTML, and have the ASP/JSP code read the file and generate the option lists or whatever it is. SQL Server can then have a trigger overwrite that file whenever there is an UPDATE or INSERT. There's some detail on one way to do it here:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=24692Also try a forum search for "bcp xml" or "trigger write file", there's some more discussion on various ways to do what you're looking for. |
 |
|
|
|
|
|