Last post Apr 23, 2015 10:14 AM by gimimex
Apr 23, 2015 09:52 AM|volar5|LINK
I am new in triggers
I want to do a trigger after deleted
Want to delete a record from a table where the key is same as in the table where I do the trigger, something like
delete dbo.[puntos ganados] where pg2=1 and exists(select sp0 from dbo.[solicitudes publicaciones] where sp0=pg3 and sp1=1 and sp2=deleted.a10
How to do that?
Apr 23, 2015 10:14 AM|gimimex|LINK
Try using the Deleted table (
https://msdn.microsoft.com/en-us/library/ms191300.aspx ) as follows:
delete from OtherTable
from Deleted as d
inner join OtherTable as o
on o.ColKey = d.ColKey
Hope this helps.