select '' as group_id from sysobjects with(nolock) where 1=2
##
if not (#SV = 'kmjxc_pro' or #SV = 'kmjxc_std' or #SV = 'bw9kbzpro' or #SV = 'tiger')
	exec('insert into t_bd_branch_group_info (group_id,branch_no,memo)
		  select group_id,branch_no,memo from #SDB..t_bd_branch_group_info')
go
if (#SV = 'hbposv7' or #SV = 'hbposv8' or #SV = 'hbposev8' or #SV = 'hbposev9') and
	(#TV = 'hbposv7' or #TV = 'hbposv8' or #TV = 'hbposev8' or #TV = 'hbposev9')
	exec('update t_bd_branch_group_info set group_name = tab_a.group_name
	from #SDB..t_bd_branch_group_info as tab_a
	where t_bd_branch_group_info.group_id = tab_a.group_id')
GO
if (#SV = 'hbposev8' or #SV = 'hbposev9') and
	(#TV = 'hbposev8' or #TV = 'hbposev9')
	exec('update t_bd_branch_group_info set group_rg = tab_a.group_rg
	from #SDB..t_bd_branch_group_info as tab_a
	where t_bd_branch_group_info.group_id = tab_a.group_id')
GO
if (#TV = 'hbposv7' or #TV = 'hbposv8' or #TV = 'hbposev8' or #TV = 'hbposev9')
	exec('update t_bd_branch_group_info set group_name = group_id where isnull(group_name,'''') = '''' ')
GO