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 |
|
whamo
Starting Member
10 Posts |
Posted - 2002-11-21 : 14:09:15
|
| I'm trying to call a USP upon the insert of a new record. My plan is to call this USP via a trigger as soon as a record is inserted. However I have never done this (normally I code out the syntax in the trigger)but for scalability reasons I need this USP seperate.Can someone help me out with the syntax?*/--------------------------------------------CREATE TRIGGER trg_Insert_TriggerName ON dbo.dyn_TableNameFOR INSERTASEXEC usp_Select_My_YSP/*Thanks |
|
|
Onamuji
Aged Yak Warrior
504 Posts |
Posted - 2002-11-21 : 14:50:48
|
| I don't think you can call a stored procedures from a trigger ... |
 |
|
|
whamo
Starting Member
10 Posts |
Posted - 2002-11-21 : 14:56:19
|
quote: I don't think you can call a stored procedures from a trigger ...
Bummer,Well, the need arises because I need a job to kick off on insert of a record. (a series of checks for validation, and data returns ensues)The smallest option I can set for a job is 1 min. That is too slow on some occasions, and overuse on others. Is there are better way to get a usp to fire on record insert? I'm open to ideas since I have given my only two.Thanks |
 |
|
|
burbakei
Yak Posting Veteran
80 Posts |
Posted - 2002-11-21 : 15:01:48
|
| yes you can call a SP in a trigger. |
 |
|
|
whamo
Starting Member
10 Posts |
Posted - 2002-11-21 : 15:04:54
|
quote: yes you can call a SP in a trigger.
Just got it, thanksI had some errors that were bieng repressed, I went through my usp, and cleaned things up a little.Works like a charm, thanks for the input. |
 |
|
|
|
|
|