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
 Question about triggers?

Author  Topic 

intern2424
Yak Posting Veteran

53 Posts

Posted - 2009-12-01 : 19:30:57
Can triggers have multiply condition within to handle multiply tables. Like if I enter only data for one table it will update that table or if I put data for two tables it will update two tables. Or should you create a trigger to do only one job.

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-12-01 : 19:36:57
why not use a SP ?
Go to Top of Page

intern2424
Yak Posting Veteran

53 Posts

Posted - 2009-12-01 : 19:53:01
Oh, I am trying to learn more about triggers. I created this trigger but i am just trying to get a better understanding of triggers.

CREATE TRIGGER trig_Add_Customer
ON Customer
FOR INSERT
AS
DECLARE @Newname VARCHAR(100)
SELECT @Newname =(SELECT Name FROM INSERTED)
PRINT 'The Customer ' + @Newname + ' has been added to the system.';
Go to Top of Page

intern2424
Yak Posting Veteran

53 Posts

Posted - 2009-12-01 : 20:31:49
My trigger works but are triggers more of a one process item while SP are more multiply process items
Go to Top of Page
   

- Advertisement -