

DELETE TItem WHERE FId != 0

SELECT * FROM TPayAccount 

UPDATE A
   SET A.FAcctId = 7462859093971055089 
  FROM TMemberCardAccount AS A
 WHERE A.FAcctId = 3
 
UPDATE A
   SET A.FAcctId = 7462859093971055089 
  FROM TMemberCardAcctHist AS A
 WHERE A.FAcctId = 3
 
UPDATE A
   SET A.FAcctId = 7462859093971055089 
  FROM TMemberCardOldAcctHist AS A
 WHERE A.FAcctId = 3
 
 UPDATE A
   SET A.FAcctId = 7462859093971055089 
  FROM TBKAccount# AS A
 WHERE A.FAcctId = 3
 
 DELETE TBKAccount# WHERE FAcctId = 7462859093971055089

SELECT * FROM TBKAccount#  WHERE FAcctId = 7462859093971055089 AND FBalance = 0 

INSERT TMemberCardAccount(FId,FMemId,FCardId,FAcctId,FDeposit,FBalance,FArrear,FCreateDate,FExpiredDate,FMemo)
SELECT dbo.FNNewId(),A.FMemId,A.FCardId,3,0,0,0,GETDATE(),NULL,''
FROM TMemberCard AS A

SELECT * FROM TMemberCardAccount

SELECT * FROM TMemberCardAccount WHERE FAcctId =  7462859093971055089

DELETE TMemberCardAccount WHERE FAcctId =  7462859093971055089

SELECT * FROM TItem

SELECT * FROM TGoods

SELECT * FROM TCompany 

SELECT * FROM TMember

UPDATE A
   SET A.FBalance = B.FBalance , 
       A.FDeposit = B.FBalance
   FROM TMemberCardAccount AS A,TBKAccount# AS B
  WHERE A.FCardId = B.FCardId
    AND A.FAcctId = B.FAcctId
    
       
       SELECT * FROM TMemberSaleBill
       
       SELECT * FROM TConsumeBill
       
       select * from TMemberCardAccount 
      
   
   
   SELECT * FROM TMemberCardAcctHist  
   