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
 General SQL Server Forums
 New to SQL Server Programming
 SQL Agent or Trigger

Author  Topic 

GregDDDD
Posting Yak Master

120 Posts

Posted - 2011-06-14 : 18:33:21
I've been working on this same project for the past week and this forum has been very helpful. Now comes the time to put the whole mess in to practice, or at least testing.

There is a table that will have rows written to it fairly infrequently, by SQL Server standards. I would say a few dozen rows a day, all during business hours. When each new row is added I need to fire a stored procedure.

What would be the best way to do this: a trigger on the table or a SQL Agent Job. Are there pros and cons to each or is it 6 in one, half dozen the other?

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2011-06-15 : 00:17:07
i think going with trigger would be a good option..
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-15 : 00:21:09
Depends what the stored procedure will do. If it's doing a ton of work that could add to the transaction time, an async Agent job could be better, just depends if the stored procedure is doing things that need to be enforced for the DML action.

Please elaborate what the stored procedure will do.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -