select '' as type_id from sysobjects with(nolock) where 1=2
##
if (#SV = 'kmjxc_pro' or #SV = 'kmjxc_pro')
	exec('insert into t_rm_vip_type(type_id,type_name,sale_way,discount,memo,oper_id,oper_date)
		  select type_id,type_name,sale_way,discount,memo,oper_id,oper_date 
		  from #SDB..pos_t_vip_type')
else if #SV = 'bw9kbzpro'
	exec('INSERT INTO t_rm_vip_type ( type_id, type_name, sale_way, discount, oper_id, oper_date,acc_flag,saving_flag) 
          select type_id,type_name,(case sale_way when ''4'' then ''1'' else sale_way end),discount,oper_id,getdate(),''0'',''1'' 
		  from  #SDB..pos_t_vip_type ')
else if #SV = 'tiger'
	exec('insert into t_rm_vip_type(type_id,type_name,sale_way,discount,memo,oper_id,oper_date,other1,other2,other3,saving_flag,memo1,memo2,memo3)
          select type_id,type_name,sale_way,discount,memo,oper_id,oper_date,other1,other2,other3,''0'','''','''','''' from #SDB..pos_vip_type')
else
	exec('insert into t_rm_vip_type (type_id,type_name,sale_way,discount,memo,oper_id,oper_date,acc_flag,acc_amt,sale_amt,other1,other2,other3,saving_flag,memo1,memo2,memo3)
		  select type_id,type_name,sale_way,discount,memo,oper_id,oper_date,acc_flag,acc_amt,sale_amt,other1,other2,other3,saving_flag,memo1,memo2,memo3 
		  from #SDB..t_rm_vip_type')

GO