update btype set BTypeFlags=dbo.SetBitValue(BTypeFlags,12,0) where deleted=0 and not exists (Select * from GSP_G_EnterpriseCheckup where BtypeId=btype.typeId)
update ptype set Flags=dbo.SetBitValue(Flags,4,0) where deleted=0 and not exists (Select * from gsp_w_spjyspb where ptypeId=ptype.typeId)



---数据备份，执行脚本，删除安装目录下data--baseinfo文件夹，重进软件再去添加首营资料