/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [F_DeptId]
      ,[F_DeptCode]
      ,[F_ParentName]
      ,[F_ParentId]
      ,[F_ParentCode]
      ,[F_DeptName]
      ,[F_State]
      ,[F_Layer]
      ,[F_Type]
      ,[F_Sort]
      ,[F_Remark]
      ,[F_Telephone]
      ,[F_Mobile]
      ,[F_OtherPhone]
      ,[F_Email]
      ,[F_Header]
  FROM [CallCenter_XinXiangXLX].[dbo].[T_Sys_Department]
  where F_DeptName like '%分公司%'
  --update [CallCenter_XinXiangXLX].[dbo].[T_Sys_Department]
  --set F_Layer=0
  --where ISNULL(F_Layer,'')=''
  
  --update [CallCenter_XinXiangXLX].[dbo].[T_Sys_Department]
  --set F_Layer=2
  --where F_DeptName like '%分公司%'
  --update [CallCenter_XinXiangXLX].[dbo].[T_Sys_Department]
  --set F_Layer=1
  --where F_DeptName like '%大区%'