USE [dbo]
GO
/****** Object: Trigger [dbo].[month_u2] Script Date: 02/01/2014 13:18:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[month_u2]
ON [dbo].[tfc_work_vouchers]
AFTER INSERT
AS
BEGIN
update tfc_work_vouchers set month='1' where month(voucher_date)=4
update tfc_work_vouchers set month='2' where month(voucher_date)=5
update tfc_work_vouchers set month='3' where month(voucher_date)=6
update tfc_work_vouchers set month='4' where month(voucher_date)=7
update tfc_work_vouchers set month='5' where month(voucher_date)=8
update tfc_work_vouchers set month='6' where month(voucher_date)=9
update tfc_work_vouchers set month='7' where month(voucher_date)=10
update tfc_work_vouchers set month='8' where month(voucher_date)=11
update tfc_work_vouchers set month='9' where month(voucher_date)=12
update tfc_work_vouchers set month='10' where month(voucher_date)=1
update tfc_work_vouchers set month='11' where month(voucher_date)=2
update tfc_work_vouchers set month='12' where month(voucher_date)=3
END
GO
/****** Object: Trigger [dbo].[month_u2] Script Date: 02/01/2014 13:18:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[month_u2]
ON [dbo].[tfc_work_vouchers]
AFTER INSERT
AS
BEGIN
update tfc_work_vouchers set month='1' where month(voucher_date)=4
update tfc_work_vouchers set month='2' where month(voucher_date)=5
update tfc_work_vouchers set month='3' where month(voucher_date)=6
update tfc_work_vouchers set month='4' where month(voucher_date)=7
update tfc_work_vouchers set month='5' where month(voucher_date)=8
update tfc_work_vouchers set month='6' where month(voucher_date)=9
update tfc_work_vouchers set month='7' where month(voucher_date)=10
update tfc_work_vouchers set month='8' where month(voucher_date)=11
update tfc_work_vouchers set month='9' where month(voucher_date)=12
update tfc_work_vouchers set month='10' where month(voucher_date)=1
update tfc_work_vouchers set month='11' where month(voucher_date)=2
update tfc_work_vouchers set month='12' where month(voucher_date)=3
END