SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Triggering Stored Procedure
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SQLMikeSQL
Starting Member

Portugal
3 Posts

Posted - 07/25/2012 :  11:38:36  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 07/25/2012 :  12:19:28  Show Profile  Reply with Quote
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

Portugal
3 Posts

Posted - 07/25/2012 :  12:31:50  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 07/25/2012 :  12:58:42  Show Profile  Reply with Quote
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

Portugal
3 Posts

Posted - 07/25/2012 :  13:06:27  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000