select top 1 '' as item_clsno,'' as item_clsname,'' as cls_parent,'' as item_flag,'' as display_flag,0 as comp_rate,'' as trans_flag 
from sysobjects with(nolock) 
where 1=2
##
if (#SV = 'isszmv6' or #SV = 'isszmv7' or #SV = 'isszmv8' or #SV = 'isszmv9') and (#TV = 'isszmv6' or #TV = 'isszmv7' or #TV = 'isszmv8' or #TV = 'isszmv9')
	exec('insert into t_bd_item_cls (item_clsno,item_clsname,cls_parent,item_flag,display_flag,return_rate,comp_rate,trans_flag)
		  select item_clsno,item_clsname,cls_parent,item_flag,display_flag,return_rate,comp_rate,trans_flag from #SDB..t_bd_item_cls')
else if (#TV = 'isszmv6' or #TV = 'isszmv7' or #TV = 'isszmv8' or #TV = 'isszmv9')
	exec('insert into t_bd_item_cls (item_clsno,item_clsname,cls_parent,item_flag,display_flag,return_rate,comp_rate,trans_flag)
		  select item_clsno,item_clsname,cls_parent,item_flag,display_flag,0,comp_rate,trans_flag from #SDB..t_bd_item_cls')
else if (#SV = 'isszmv6' or #SV = 'isszmv7' or #SV = 'isszmv8' or #SV = 'isszmv9')
	exec('insert into t_bd_item_cls (item_clsno,item_clsname,cls_parent,item_flag,display_flag,profit_rate,comp_rate,trans_flag)
		  select item_clsno,item_clsname,cls_parent,item_flag,display_flag,0,comp_rate,trans_flag from #SDB..t_bd_item_cls')
else 
	exec('insert into t_bd_item_cls (item_clsno,item_clsname,cls_parent,item_flag,display_flag,profit_rate,comp_rate,trans_flag)
		  select item_clsno,item_clsname,cls_parent,item_flag,display_flag,profit_rate,comp_rate,trans_flag from #SDB..t_bd_item_cls')
GO