请按下面的指导操作,特别注意:做删除操作前一定要先备份!!!做删除操作前一定要先备份!!!做删除操作前一定要先备份!!!--表结构说明T_HR_SSocEmpSocFiles--社保档案表,记录参保规则、参保组织、人员idT_HR_SSocEmpSocFilesEntry--社保档案分录,主要记录险种缴纳信息,该表中FBilLId字段对应T_HR_SSocEmpSocFiles的FidT_HR_SSocEmpSocFilesEntryHis--同分录表--下述删除是删除同一参保规则的社保档案信息---查询需要删除的数据量是否和客户要求的一致selectcount(*)fromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码')selectcount(1)fromT_HR_SSocEmpSocFilesEntrywhereFBillIdin(selectfidfromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码'));selectcount(1)fromT_HR_SSocEmpSocFilesEntryHiswhereFBillIdin(selectfidfromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码'));--***备份***(如果备份时提示“标识符过长”,请缩短表名长度)select*intoT_HR_SSocEmpSocFiles_20160509fromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码')--表明后面一般为备份的日期selectcount(*)fromT_HR_SSocEmpSocFiles_20160509;--查询是否备份成功select*intoT_HR_SSocFilesEntry_160509fromT_HR_SSocEmpSocFilesEntrywhereFBillIdin(selectfidfromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码'));selectcount(*)fromT_HR_SSocFilesEntry_160509;select*intoT_HR_SSocEntryHis_160509fromT_HR_SSocEmpSocFilesEntryHiswhereFBillIdin(selectfidfromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码'));selectcount(*)fromT_HR_SSocEntryHis_160509;--删除deletefromT_HR_SSocEmpSocFilesEntrywhereFBillIdin(selectfidfromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码'));deletefromT_HR_SSocEmpSocFilesEntryHiswhereFBillIdin(selectfidfromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码'));deletefromT_HR_SSocEmpSocFileswhereFSocTypeIDin(selectfidfromT_HR_SSocTypewherefnumber='参保规则编码')