
if exists(select 1 from sysobjects where name='tr_mess_t_vip_message_i')
  drop Trigger tr_mess_t_vip_message_i
go

create trigger tr_mess_t_vip_message_i on mess_t_vip_message
after insert
as
begin
	insert into mess_t_vip_message_wx
	(
		mess_type, send_flag, oper_date, branch_no, card_id, card_type,
		to_card_type, father_card, giv_acc_num, oper_type, change_amt,
		savelist_amt, flow_no, item_no, acc_num, flow_amt,
		send_year, send_date, card_little, send_times, mess_flow_id
	)
	select mess_type, send_flag, oper_date, branch_no, card_id, card_type,
		to_card_type, father_card, giv_acc_num, oper_type, change_amt,
		savelist_amt, flow_no, item_no, acc_num, flow_amt,
		send_year, send_date, card_little, isnull(send_times,1), flow_id
	from inserted
end
go

