SELECT * FROM TImpMember EXEC sp_rename 'TImpMember.列 0','FMemNo' EXEC sp_rename 'TImpMember.列 2','FFaceNo' EXEC sp_rename 'TImpMember.列 4','FName' EXEC sp_rename 'TImpMember.列 25','FMobile' EXEC sp_rename 'TImpMember.列 14','FCreateDate' EXEC sp_rename 'TImpMember.列 15','FExpiredDate' ALTER TABLE TImpMember ADD FGender INT ALTER TABLE TImpMember ADD FBalance DECIMAL(18,6) select * into #gcm12 from gcm12 where 1=0 SELECT * FROM gcm01 WHERE gca00c = '009' SELECT CONVERT(VARCHAR,CAST(FCreateDate AS DATETIME),23) FROM TImpMember insert gcm12(gcn00c,gcn01c,gcn02c,gcn03c,gcn04c,gcn09f,gcn10i,gcn12d,gcn13d,gcn15c,gcn16f,gcn17c,gcn22i,gcn24i,gcn33c,gcn34c,gcn35c) select '009',FMemNo,'992',FName,LEFT(FMobile,11),FBalance,'0',LEFT(REPLACE(CONVERT(VARCHAR,CAST(FCreateDate AS DATETIME),23),'-',''),8), LEFT(REPLACE(CONVERT(VARCHAR,CAST(FExpiredDate AS DATETIME),23),'-',''),8), FMemNo,0,'009','1','1','admin','20170225','20170225' FROM TImpMember DELETE gcm12 WHERE gcn00c = '009' from gcm12_lishi SELECT * FROM gcm12 WHERE gcn00c = '009' UPDATE TImpMember SET FGender = CASE WHEN [列 5] = '男' THEN 1 ELSE 0 END UPDATE A SET A.FBalance = B.[列 1] FROM TImpMember AS A,TImpMember_Balance AS B WHERE A.FMemNo = B.[列 0] SELECT * FROM TImpMember_Balance SELECT * FROM TImpMember WHERE FMemNO = '0008834171' SELECT * FROM gsm02 WHERE gsb00c = '009' UPDATE gsm02 SET gsb06c = '1',gsb06i = 1