use dingxiang_xiaogao


SELECT * FROM TMemberArrear 

UPDATE A
   SET A.FCardId = B.FCardId
  FROM TBKMember# AS B,TMemberArrear AS A
 WHERE A.FMemId = B.FMemId
 AND A.FCardId = 0 
 
 UPDATE A
    SET A.FArrearCardId = B.FCardId
  FROM TMemberSaleRepay AS A,TMemberArrear AS B
 WHERE A.FArrearId = B.FId
 AND A.FArrearCardId = 0
 
 EXEC PSetEmpPerfCacheExpired 1