
SELECT * FROM TPayAccount 


DELETE TBasicType

SELECT * FROM TCourse

DELETE TGoods
WHERE FId NOT IN(SELECT FId FROM QingDao_PinShang_bak..TGoods)

EXEC
PImportTable 'QingDao_PinShang_bak..TItemDiscountMaster','QingDao_PinShang..TItemDiscountMaster',''



SELECT * FROM 

SELECT * FROM TGoods

SELECT * FROM QingDao_PinShang..TItemDiscountDetail
WHERE FId NOT IN(SELECT FId FROM QingDao_PinShang_bak..TItemDiscountDetail)

DELETE TItemDiscountDetail WHERE FId NOT IN(SELECT FId FROM QingDao_PinShang_bak..TItemDiscountDetail)
DELETE TItemDiscountMid WHERE FId NOT IN(SELECT FId FROM QingDao_PinShang_bak..TItemDiscountMid)
DELETE TItemDiscountMaster WHERE FId NOT IN(SELECT FId FROM QingDao_PinShang_bak..TItemDiscountMaster)


SELECT * FROM QingDao_PinShang_bak..TItemDiscountDetail
WHERE FId NOT IN(SELECT FId FROM QingDao_PinShang..TItemDiscountDetail)



EXEC
PImportTable 'QingDao_PinShang_mingjiang..TCompany','QingDao_PinShang..TCompany',' AND FNo = ''005'''


EXEC
PImportTable 'QingDao_PinShang_mingjiang..TUser','QingDao_PinShang..TUser',' AND FId > 1'

EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMemberCardTypeSub','QingDao_PinShang..TMemberCardTypeSub',' AND FId > 10'


SELECT * FROM QingDao_PinShang_mingjiang..TMemberCardType

UPDATE  QingDao_PinShang_mingjiang..TMemberCardType

SET FNo = 'MJ'+FNo



SELECT * FROM TMember WHERE FMemNo IN(SELECT FMemNO FROM QingDao_PinShang_mingjiang..TMember)

 

SELECT * FROM QingDao_PinShang..TMemberCardType 




SELECT * FROM QingDao_pinshang_mingjiang..TCompany

UPDATE QingDao_pinshang_mingjiang..TCompany set fno = '005'
WHERE FNO = '001'

UPDATE QingDao_pinshang_mingjiang..TMember set FMemNo = 'M' + FMemNo
UPDATE QingDao_pinshang_mingjiang..TMemberCard set FCardNo = 'M' + FCardNo

WHERE FNO = '001'

SELECT * FROM QingDao_PinShang_mingjiang..TMember
WHERE FMemNo IN(SELECT FMemNO FROM TMember)


EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMember','QingDao_PinShang..TMember',' AND FMemId > 1'

EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMemberCard','QingDao_PinShang..TMemberCard',' AND FMemId > 1'

EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMemberCardAccount','QingDao_PinShang..TMemberCardAccount',' AND FMemId > 1'



EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMemberCardAcCTHIST','QingDao_PinShang..TMemberCardAcCTHIST',' AND FMemId > 1'


EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMemberCardOldAcCTHIST','QingDao_PinShang..TMemberCardOldAcCTHIST',' AND FMemId > 1'

EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMemberOldTransHIST','QingDao_PinShang..TMemberOldTransHIST',' AND FMemId > 1'

EXEC
PImportTable 'QingDao_PinShang_mingjiang..TMemberArrear','QingDao_PinShang..TMemberArrear',' AND FMemId > 1'



SELECT * FROM TCompany

UPDATE TMember SET FCompId = 8827968758873589172 WHERE FMemId IN(SELECT FMemId FROM QingDao_PinShang_mingjiang..TMember)
UPDATE TMemberCard SET FCompId = 8827968758873589172 WHERE FCardId IN(SELECT FCardId FROM QingDao_PinShang_mingjiang..TMemberCard)
UPDATE TMemberCardAcctHist SET FCompId = 8827968758873589172 WHERE FCardId IN(SELECT FCardId FROM QingDao_PinShang_mingjiang..TMemberCardAcctHist)
UPDATE TMemberCardoLDAcctHist SET FCompId = 8827968758873589172 WHERE FCardId IN(SELECT FCardId FROM QingDao_PinShang_mingjiang..TMemberCardoLDAcctHist)
UPDATE TMemberOldTransHist SET FCompId = 8827968758873589172 WHERE FMemId IN(SELECT FMemId FROM QingDao_PinShang_mingjiang..TMemberOldTransHist)
UPDATE TMemberArrear SET FCompId = 8827968758873589172 WHERE FMemId IN(SELECT FMemId FROM QingDao_PinShang_mingjiang..TMemberArrear)
