-- ----------------------------
-- Triggers structure for table [dbo].[bank]
-- ----------------------------
DROP TRIGGER [dbo].[tr_delete]
GO
CREATE TRIGGER [dbo].[tr_delete]
ON [dbo].[bank]
INSTEAD OF DELETE
AS
BEGIN
-- type your statements here
update bank set balance=balance+1000 where cid=(select cid from deleted)
END
GO
DROP TRIGGER [dbo].[tr_insert]
GO
CREATE TRIGGER [dbo].[tr_insert]
ON [dbo].[bank]
AFTER INSERT
AS
BEGIN
--delete * from bank where cid=(select cid from inserted)
update bank set balance=balance+10 where cid=(select cid from inserted)
END
GO