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 2008 Forums
 Transact-SQL (2008)
 Triggering Stored Procedure

Author  Topic 

SQLMikeSQL
Starting Member

3 Posts

Posted - 2012-07-25 : 11:38:36
Need a trigger to run a stored procedure after insert in specific table, if inserted in a specific field a certain value.
For example, have a table of movement and need to be executed a stored procedure when a value is inserted in a specific field. The stored procedure executes movements on all the records from a table, only interests me running on the records containing the value entered in a field in the first table.
I hope I have been explicit, thank you for your help.

Thanks in advance.
Miguel Teixeira

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-25 : 12:19:28
why do you need a trigger for this? isnt it better to have a unified insert procedure including this logic?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

SQLMikeSQL
Starting Member

3 Posts

Posted - 2012-07-25 : 12:31:50
I need a trigger, because this stored procedure that is originally used by an application's functionality, and it is performed to reconstruct a totals table by recalculating all lines of movement. Intends to make the recalculation of movements that contain only references to specific values ??entered in the first table, to expedite the process.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-07-25 : 12:58:42
and this totalling has to been on realtime? even if thats case cant you wrap this logic itself in trigger? why add a second proc call?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

SQLMikeSQL
Starting Member

3 Posts

Posted - 2012-07-25 : 13:06:27
this totalling has to be on realtime, because this controls the number of items in a certain table and the only way to have the real values is by runing this SP when they are inserted by a specific document.
Go to Top of Page
   

- Advertisement -