For MS SQL Server:

CREATE TRIGGER UpdateFlagCheck
ON dbo.TableOne
FOR UPDATE
AS
IF UPDATE(FlagField)
BEGIN
     DELETE FROM dbo.TableTwo
     WHERE TableTwo.Job_ID = inserted.Job_ID AND inserted.FlagField = 1
END
|-----------------+-------------------------------------------------------|
|Eric A. Laney    |"If the aborigine drafted an I.Q. test, all of Western |
|Systems Engineer |civilization would presumably flunk it."               |
|LAN Optimization |                                                       |
|Team             |                                                       |
|Verizon Data     |                                           Stanley Garn|
|Services         |                                                       |
|Voice:           |                                                       |
|813.978.4404     |                                                       |
|Pager:           |                                                       |
|888.985.8519     |                                                       |
|-----------------+-------------------------------------------------------|





                                                                                       
                           
                    Bill                                                               
                           
                    Killillay            To:     SQL <[EMAIL PROTECTED]>           
                           
                    <BillK@active        cc:                                           
                           
                    group.net>           Subject:     Update, Delete Trigger Help 
Needed??  Plz                   
                                                                                       
                           
                    2001-10-05                                                         
                           
                    12:29                                                              
                           
                    Please                                                             
                           
                    respond to                                                         
                           
                    sql                                                                
                           
                                                                                       
                           
                                                                                       
                           




I am trying to create a trigger that checks one table every time it's
updated for a value in one of the fields, if that value is a one, it then
needs to delete an entry in another table where both tables job_id matches.

Does anybody have an idea what this might look like?  It's been a long week
and my eyes, and brain are fried... any help would be greatly appreciated.

Thanks,
Bill K.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to