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 2005 Forums
 Transact-SQL (2005)
 Trigger vs, Stored Procedure

Author  Topic 

ajm_otn@poriver.com
Starting Member

2 Posts

Posted - 2008-12-23 : 13:57:18
Howdy!

I have a situation where I am not sure the best possible solution.

I have a table (VForms)
The table has a formstatusid. When the status gets updated to a 3
I need to write the data and additional data to a separate table (report). I will then use the report table to generate reports.

I have looked at a trigger. But I need to get additional data from other tables (doing joins) to insert. I am with the understanding that I should not set any variables or do any type of logic in the Trigger. So I am thinking of calling a stored procedure, passing the variables from the insert to the stored proc to do all the other data manipulation.

Any thoughts on this subject?
I know this is very vague.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-23 : 14:15:05
A stored procedure sounds like the right plan.

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 -