You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
sql-tools/更改账户.sql

61 lines
1.5 KiB

use qingdao_baobeimeng
SELECT * FROM TPayAccount WHERE FName LIKE '%¸£Õò%'
SELECT * FROM TCompany WHERE FNo = '013'
SELECT * FROM TPayAccount WHERE FId = 5464408785164857671
SELECT * FROM TConsumeBill WHERE FCompId =3472612862772379648
SELECT * INTO #Card FROM TMemberCard WHERE FCompId = 3472612862772379648
SELECT * FROM TMemberCardAccount WHERE FCardId IN(SELECT FCardId FROM #Card)
UPDATE A
SET A.FAcctId = 5175462275344078215
FROM TMemberCardAccount AS A
WHERE A.FCardId IN(SELECT FCardId FROM #Card)
AND A.FAcctId = 3
UPDATE A
SET A.FAcctId = 5175462275344078215
FROM TMemberCardAcctHist AS A
WHERE A.FCardId IN(SELECT FCardId FROM #Card)
AND A.FAcctId = 3
UPDATE A
SET A.FAcctId = 5175462275344078215
FROM TMemberCardOldAcctHist AS A
WHERE A.FCardId IN(SELECT FCardId FROM #Card)
AND A.FAcctId = 3
UPDATE A
SET A.FPayTypeId = 5175462275344078215
FROM TConsumeItemPayment AS A,TConsumeBill AS B
WHERE B.FCardId IN(SELECT FCardId FROM #Card)
AND A.FBillId = B.FBillId
AND A.FPayTypeId = 3
UPDATE A
SET A.FContentId = 5175462275344078215
FROM TMemberArrear AS A
WHERE A.FCardId IN(SELECT FCardId FROM #Card)
AND A.FContentId = 3
UPDATE A
SET A.FAcctId = 5175462275344078215
FROM TMemberSaleCard AS A
WHERE A.FCardId IN(SELECT FCardId FROM #Card)
AND A.FAcctId = 3
UPDATE A
SET A.FPayTypeId = 5175462275344078215
FROM TMemberSalePayment AS A,TMemberSaleBill AS B
WHERE B.FPayCardId IN(SELECT FCardId FROM #Card)
AND A.FBillId = B.FBillId
AND A.FPayTypeId = 3