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
 Creating trigger on a view for insert

Author  Topic 

fugazi
Starting Member

6 Posts

Posted - 2009-09-02 : 07:23:16
Hello !

Is it possible to create a trigger on a view for a new entry ? I was thinking about this syntax like on a table but it's not working on a view :

CREATE TRIGGER [new reject part] ON [dbo].[vw_HardnessTester]
FOR INSERT
AS
EXEC master..xp_cmdshell 'net send mycomputer New rejected parts entry for hardness'

I want to receive a 'net send' for each new entry in this view...

What's the problem ?

thanks again

Daniel

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-09-02 : 07:43:17
duplicate
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=131956
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-02 : 08:32:49
quote:
Originally posted by fugazi

Hello !

Is it possible to create a trigger on a view for a new entry ? I was thinking about this syntax like on a table but it's not working on a view :

CREATE TRIGGER [new reject part] ON [dbo].[vw_HardnessTester]
FOR INSERT
AS
EXEC master..xp_cmdshell 'net send mycomputer New rejected parts entry for hardness'

I want to receive a 'net send' for each new entry in this view...

What's the problem ?

thanks again

Daniel



why use trigger for this? wont a job to execute procedure to execute the logic be sufficient?
Go to Top of Page

fugazi
Starting Member

6 Posts

Posted - 2009-09-02 : 19:23:52
Ok so how to do it ? (stored procedure)

thank you for your help !

Daniel
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-09-03 : 06:51:51
yes
Go to Top of Page
   

- Advertisement -