use qingdao_mingyu SELECT * FROM TConsumeBill SELECT * FROM TCompany EXEC P SELECT * FROM TConsumeBill WHERE FCompId != 8595836085995130159 AND FMemId IN(SELECT FMemId FROM TMemberCard WHERE FCompId = 8595836085995130159) AND FMemId > 0 SELECT * FROM TConsumeItemPayment WHERE FBillId = 4995224843651602613 SELECT * FROM TItem WHERE FId IN(SELECT FItemId FROM TItemSub WHERE FCompId = 8595836085995130159) SELECT * FROM TGoods SELECT * FROM TInventoryLog SELECT * FROM TUser SELECT * FROM TMemberCourseLog SELECT * FROM TBasicType WHERE FKey LIKE '%DIs%' SELECT * FROM TCompany UPDATE TCompany SET FNo = FNo + '已停用' WHERE FNo = '002' SELECT * EXEC PImportTable 'TItem','TItem_','AND FId IN(SELECT FItemId FROM TItemSub WHERE FCompId = 8595836085995130159 )' EXEC PImportTable 'TBasicType','TBasicType_',' AND FKey IN (''ItemType'',''ItemDiscountType'',''GoodsType'',''GoodsDiscountType'')' EXEC PImportTable 'TEmployee','TEmployee_','AND FId IN(SELECT FEmpId FROM TEmployeeSub WHERE FCompId = 8595836085995130159 )' DELETE db186.QingDao_XiuMeiQi.dbo.TBasicType WHERE FId IN(SELECT FId FROM TBasicType_) EXEC PImportTable 'TBasicType','TBasicType_',' AND FKey IN (''ItemType'',''ItemDiscountType'',''GoodsType'',''GoodsDiscountType'',''Position'',''Department'')' EXEC PImportTable 'TItem_','db186.QingDao_XiuMeiQi.dbo.TItem',' AND FId IN(SELECT FItemId FROM TItemSub WHERE FCompId = 8595836085995130159 )' EXEC PImportTable 'TItemSub','db186.QingDao_XiuMeiQi.dbo.TItemSub',' AND FCompId = 8595836085995130159 ' EXEC PImportTable 'TBasicType','db186.QingDao_XiuMeiQi.dbo.TBasicType',' AND FKey = ''ItemType''' EXEC PImportTable 'TBasicType_','db186.QingDao_XiuMeiQi.dbo.TBasicType','' EXEC PImportTable 'TGoods','db186.QingDao_XiuMeiQi.dbo.TGoods',' AND FId IN(SELECT FGoodsId FROM TGoodsSub WHERE FCompId = 8595836085995130159 )' EXEC PImportTable 'TGoodsSub','db186.QingDao_XiuMeiQi.dbo.TGoodsSub',' AND FCompId = 8595836085995130159 ' EXEC PImportTable 'TGoodsMultiUnit','db186.QingDao_XiuMeiQi.dbo.TGoodsMultiUnit',' ' EXEC PImportTable 'TEmployee_','db186.QingDao_XiuMeiQi.dbo.TEmployee',' ' EXEC PImportTable 'TEmployeeSub','db186.QingDao_XiuMeiQi.dbo.TEmployeeSub',' AND FCompId = 8595836085995130159 ' EXEC PImportTable 'TMemberCardType','db186.QingDao_XiuMeiQi.dbo.TMemberCardType',' AND FId > 1 AND FId IN(SELECT FCardTypeId FROM TMemberCardTypeSub WHERE FCompId = 8595836085995130159 )' EXEC PImportTable 'TItemBaseComm','db186.QingDao_XiuMeiQi.dbo.TItemBaseComm',' AND FCompId = 8595836085995130159 ' EXEC PImportTable 'TGoodsMultiUnit','db186.QingDao_XiuMeiQi.dbo.TGoodsMultiUnit',' ' UPDATE G SET G.FUnitId = S1.FId FROM db186.QingDao_XiuMeiQi.dbo.TGoods AS G, db186.QingDao_XiuMeiQi.dbo.TBasicType AS S1,TBasicType AS S2 WHERE S1.FKey = 'GoodsUnit' AND S2.FKey = 'GoodsUnit' AND G.FUnitId = S2.FId AND S2.FNo = S1.FNo AND G.FId IN(SELECT FId FROM TGoods) UPDATE TItem_ SET FNoOfPad = FNo WHERE FNo IN (SELECT FNo FROM db186.QingDao_XiuMeiQi.dbo.TItem) UPDATE A SET FNo = FNo + '.006' FROM TBasicType_ AS A WHERE EXISTS(SELECT FNo FROM db186.QingDao_XiuMeiQi.dbo.TBasicType AS B WHERE B.FKey = A.FKey AND B.FNo = A.FNo) SELECT * INTO TMember_002 FROM TMember WHERE FMemId IN() SELECT * FROM TEmployee UPDATE TEmployee_ SET FNo = FNo + '.006' SELECT * FROM TBasicType WHERE FKey LIKE '%Dep%' SELECT * FROM TBasicType_ EXEC PImportTable 'TPayAccount','TPayAccount_','AND FId = 8286177046398127146 ' UPDATE TPayAccount_ SET FNo = FNo + '.006' EXEC PImportTable 'TPayAccount_','db186.QingDao_XiuMeiQi.dbo.TPayAccount',' ' SELECT * FROM TConsumeBill ORDER BY FBillTime DESC DELETE TUserAllowCompany WHERE FCompId = 8595836085995130159 --导会员 EXEC PImportTable 'TMemberCard','TMemberCard_','AND FCompId = 8595836085995130159 ' EXEC PImportTable 'TMemberCard','TMemberCard_','AND FCompId != 8595836085995130159 AND FCardId IN(SELECT FCardId FROM TConsumeBill WHERE FCompId = 8595836085995130159 AND FCardId!= 0 ) ' EXEC PImportTable 'TMemberCardType','TMemberCardType_',' ' EXEC PImportTable 'TMember','TMember_','AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberCardType_','db186.QingDao_XiuMeiQi.dbo.TMemberCardType',' ' EXEC PImportTable 'TMemberCard_','db186.QingDao_XiuMeiQi.dbo.TMemberCard',' ' EXEC PImportTable 'TMember_','db186.QingDao_XiuMeiQi.dbo.TMember ',' ' EXEC PImportTable 'TMemberCardAccount','db186.QingDao_XiuMeiQi.dbo.TMemberCardAccount',' AND FCardId IN(SELECT FCardId FROM TMemberCard_) ' EXEC PImportTable 'TMemberCardAcctHist','db186.QingDao_XiuMeiQi.dbo.TMemberCardAcctHist',' AND FCardId IN(SELECT FCardId FROM TMemberCard_) ' EXEC PImportTable 'TMemberTransHist','db186.QingDao_XiuMeiQi.dbo.TMemberTransHist',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberArrear','db186.QingDao_XiuMeiQi.dbo.TMemberArrear',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberRepay','db186.QingDao_XiuMeiQi.dbo.TMemberRepay',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberArrearEmployee','db186.QingDao_XiuMeiQi.dbo.TMemberArrearEmployee',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberPhoto','db186.QingDao_XiuMeiQi.dbo.TMemberPhoto',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberPointHist','db186.QingDao_XiuMeiQi.dbo.TMemberPointHist',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberOldTransHist','db186.QingDao_XiuMeiQi.dbo.TMemberOldTransHist',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' EXEC PImportTable 'TMemberCardOldAcctHist','db186.QingDao_XiuMeiQi.dbo.TMemberCardOldAcctHist',' AND FMemId IN(SELECT FMemId FROM TMemberCard_) ' ALTER TABLE TMemberArrear DROP COLUMN FSyncAccount PDROPCOLUMN 'TMemberArrear','FSyncAccount' UPDATE TMemberCardType_ SET FId = LEFT(FId,18) UPDATE TMemberCard_ SET FTypeId = LEFT(FTypeId,18) SELECT * FROM SYSOBJECTS WHERE NAME LIKE '%TMember%' AND type = 'U' UPDATE TMemberCard SET FState = 4,FMemo = FMemo + '【万科城市花园的卡已经转移到秀美琦】' WHERE FCardId IN(SELECT FCardId FROM TMemberCard_) SELECT dbo.FNCompNo(FCompId) FROM TMemberCard_ SELECT * FROM db186.QingDao_XiuMeiQi.dbo.TMemberCard WHERE FCompId IN(SELECT FId FROM TCompany) UPDATE db186.QingDao_XiuMeiQi.dbo.TMember SET FMemo = '【名语金日紫都店的卡,因为在万科城消费过,所以导入了过来】', FDeleted = 1, FMemNo = FMemNo + '已删' WHERE FMemId = 5013852231770696766 UPDATE db186.QingDao_XiuMeiQi.dbo.TMemberCard SET FMemo = '【名语金日紫都店的卡,因为在万科城消费过,所以导入了过来】', FDeleted = 1, FCardNo = FCardNo + '已删' WHERE FMemId = 5013852231770696766 DELETE TMemberCardAccount WHERE FMemId = 5013852231770696766