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/Import/芒果/ve-252F.tmp

125 lines
3.0 KiB

1 year ago
SELECT * FROM TMember
SELECT * FROM TMGWMember
WHERE <EFBFBD><EFBFBD>ǰ״̬
SELECT * FROM TMGWMember
WHERE 1=1
--AND <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = ''
--AND FDeleted = 0
AND <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>!= '1<EFBFBD><EFBFBD>-1<EFBFBD><EFBFBD>[<EFBFBD><EFBFBD><EFBFBD><EFBFBD>]'
WHERE <EFBFBD><EFBFBD>ǰ״̬ = 'ע<EFBFBD><EFBFBD>'
SELECT <EFBFBD><EFBFBD>ǰ״̬ FROM TMGWMember
GROUP BY <EFBFBD><EFBFBD>ǰ״̬
--
IF OBJECT_ID('TMGWCompany') IS NULL
BEGIN
CREATE TABLE TMGWCompany
(
FCompName VARCHAR(50),
FCompNo VARCHAR(50),
FCompId BIGINT
)
END
SELECT FName FROM TCompany
SELECT <EFBFBD><EFBFBD><EFBFBD><EFBFBD> FROM TMGWMember
group by <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
DELETE TMGWCompany
INSERT TMGWCompany(FCompName,FCompNo)
SELECT 'â<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>','002'
INSERT TMGWCompany(FCompName,FCompNo)
SELECT 'â<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><EFBFBD><EFBFBD>','003'
INSERT TMGWCompany(FCompName,FCompNo)
SELECT 'â<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','004'
INSERT TMGWCompany(FCompName,FCompNo)
SELECT 'â<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>','005'
UPDATE A
SET A.FCompId = B.FId
FROM TMGWCompany AS A,TCompany AS B
WHERE A.FCompNo = B.FNo
--
ALTER TABLE TMGWMember ADD FDeleted BIT
ALTER TABLE TMGWMember ADD FState INT
ALTER TABLE TMGWMember ADD FMemId BIGINT
ALTER TABLE TMGWMember ADD FMemNo VARCHAR(50)
ALTER TABLE TMGWMember ADD FName VARCHAR(50)
ALTER TABLE TMGWMember ADD FMobilePhone VARCHAR(50)
ALTER TABLE TMGWMember ADD FBirthday DATETIME
ALTER TABLE TMGWMember ADD FBirthdayType CHAR
ALTER TABLE TMGWMember ADD FCompId BIGINT
ALTER TABLE TMGWMember ADD FMemo VARCHAR(2222)
ALTER TABLE TMGWMember ADD FCreateDate DATETIME
--
UPDATE TMGWMember SET FDeleted = 1 WHERE <EFBFBD><EFBFBD>ǰ״̬ != '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
UPDATE TMGWMember SET FDeleted = 0 WHERE <EFBFBD><EFBFBD>ǰ״̬ = '<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
--<EFBFBD><EFBFBD>ԱID
UPDATE TMGWMember SET FMemId = dbo.FNNewId()
--<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE TMGWMember SET FMemNo = <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE TMGWMember SET FName = <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
--<EFBFBD>ֻ<EFBFBD>
UPDATE TMGWMember SET FMobilePhone = <EFBFBD><EFBFBD>ϵ<EFBFBD>
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
UPDATE TMGWMember SET FCreateDate = <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
--״̬
UPDATE TMGWMember SET FState = 1 WHERE <EFBFBD><EFBFBD>ǰ״̬='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
--<EFBFBD><EFBFBD>ע
UPDATE TMGWMember SET FMemo = <EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD>Ϣ
--<EFBFBD><EFBFBD>˾
UPDATE A
SET A.FCompId = B.FCompId
FROM TMGWMember AS A,TMGWCompany AS B
WHERE A.<EFBFBD><EFBFBD><EFBFBD><EFBFBD> = B.FCompName
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
UPDATE TMGWMember SET FBirthdayType = 'G' WHERE <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD> LIKE '%<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%'
UPDATE TMGWMember SET FBirthdayType = 'L' WHERE <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD> LIKE '%ũ<EFBFBD><EFBFBD>%'
UPDATE A SET FBirthday =
-- SELECT
CAST( '9999-' +
REPLACE(
REPLACE(
REPLACE(
REPLACE(<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,'<EFBFBD><EFBFBD>',''),'<EFBFBD><EFBFBD>',''),'[ũ<EFBFBD><EFBFBD>]',''),'[<EFBFBD><EFBFBD><EFBFBD><EFBFBD>]','') AS DATETIME)
FROM TMGWMember AS A
WHERE <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD> LIKE '%<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%'
AND <EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD> != '1<EFBFBD><EFBFBD>-1<EFBFBD><EFBFBD>[<EFBFBD><EFBFBD><EFBFBD><EFBFBD>]'
SELECT 'EXEC PDeleteMemberSaleBill ' + CAST(FBillId AS VARCHAR(22)) FROM TMemberSaleBill
Truncate table TMemberOldTransHist
Truncate table TMemberCardOldAcctHist
Truncate table TMemberArrear
Truncate table TMemberArrearEmployee
Truncate table TMemberRepay
Truncate table TMemberCardAccount
Truncate table TMemberCardAcctHist
Truncate table TMemberCourse
Truncate table TMemberTransHist
Truncate table TMemberCourseHist
Truncate table TMemberPointHist
Truncate table TMemberPhoto