p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server 2000 (http://p2p.wrox.com/forumdisplay.php?f=20)
-   -   Can trigger call store procedure ? (http://p2p.wrox.com/showthread.php?t=29438)

eddy0055 May 17th, 2005 11:49 PM

Can trigger call store procedure ?
 
Can i create trigger call store procedure ?.if can please show me how i do that

thank you every body for help. :D


shahchi1 May 18th, 2005 09:58 AM

you mean calling a stored procedure within a trigger

You can...but ask yourself two times you really wanted to do that

an example from BOL, it uses xp_sendmail extended stored procedure

USE pubs
IF EXISTS (SELECT name FROM sysobjects
     WHERE name = 'reminder' AND type = 'TR')
DROP TRIGGER reminder
GO
CREATE TRIGGER reminder
ON titles
FOR INSERT, UPDATE, DELETE
AS
EXEC master..xp_sendmail 'MaryM',
     'Don''t forget to print a report for the distributors.'
GO


All times are GMT -4. The time now is 08:08 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.