新闻动态

分部帐套变为总部帐套的方法(V6系列、Z7系列、V9商业)

2019-03-04 21:42:57

1、分部帐套改总部,

将分部的帐套不压缩方式备份,然后到总部建立一个总部帐套,用不压缩方式恢复分部的备份包,
在恢复了数据之后,进入SQLSERVER查询分析器中选择总部帐套数据库执行:
update sys_t_system set sys_var_value='1' where sys_var_id='Is_Distributed'
update sys_t_system set sys_var_value='00' where sys_var_id in ('g_branch_no','branch_id')
update sys_t_system set sys_var_value='0001' where sys_var_id in ('gs_defa_branch','pos_branch_no')
update bw_tab_tabledesc set max_change='99999'
update cm_t_remote_transrecord set up_change=0,down_change=0

2、然后在总部给每个分部用文件方式,一般方式打包一次。

3、在每个分部都执行下面的命令:汇总总部打的数据包,然后用文件方式打包给总部。到总部汇总。
update cm_t_remote_transrecord set up_change=0,down_change=0
update ic_t_inout_store_master set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'
update ic_t_dist_inout_master set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'
update ic_t_check_init set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'
update ic_t_check_master set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'
update sm_t_salesheet set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'
update co_t_order_main set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'
update ic_t_combo_master set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'
update pm_t_flow_main set cm_branch=(select sys_var_value from sys_t_system where sys_var_id='branch_id') where cm_branch='zz'