0:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 0:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 0:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 0:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 1:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 1:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 1:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 2:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 2:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 2:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 2:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 3:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 3:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 3:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 3:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 4:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 4:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 4:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 4:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 5:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 5:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 5:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 5:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 6:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 6:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 6:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 6:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 7:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 7:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 7:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 7:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 8:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 8:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 8:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 8:58:06 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:58:06 26 มีนาคม 2561 :try to logon with: GS1WS 9:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 9:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 9:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 9:02:04 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:02:04 26 มีนาคม 2561 :try to logon with: GS1WS 9:05:21 26 มีนาคม 2561 :Server was unable to process request. ---> Cannot open database "RDtmp" requested by the login. The login failed. 9:27:19 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:27:19 26 มีนาคม 2561 :try to logon with: GS1WS 9:27:19 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:27:19 26 มีนาคม 2561 :try to logon with: GS1WS 9:27:40 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:27:40 26 มีนาคม 2561 :try to logon with: GS1WS 9:28:23 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:28:23 26 มีนาคม 2561 :try to logon with: GS1WS 9:28:36 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:28:36 26 มีนาคม 2561 :try to logon with: GS1WS 9:29:36 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:29:36 26 มีนาคม 2561 :try to logon with: GS1WS 9:30:58 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:30:58 26 มีนาคม 2561 :try to logon with: GS1WS 9:32:08 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:32:08 26 มีนาคม 2561 :try to logon with: GS1WS 9:34:52 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:34:52 26 มีนาคม 2561 :try to logon with: GS1WS 9:37:18 26 มีนาคม 2561 :Server was unable to process request. ---> Cannot open database "RDtmp" requested by the login. The login failed. 10:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 10:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 10:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 10:04:38 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:04:38 26 มีนาคม 2561 :try to logon with: GS1WS 10:21:03 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:21:03 26 มีนาคม 2561 :try to logon with: GS1WS 10:21:24 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:21:24 26 มีนาคม 2561 :try to logon with: GS1WS 10:21:39 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:21:39 26 มีนาคม 2561 :try to logon with: GS1WS 10:23:28 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:23:28 26 มีนาคม 2561 :try to logon with: GS1WS 11:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 11:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 11:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 11:10:13 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:10:13 26 มีนาคม 2561 :try to logon with: GS1WS 11:54:28 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:54:28 26 มีนาคม 2561 :try to logon with: GS1WS 12:00:27 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:00:27 26 มีนาคม 2561 :try to logon with: GS1WS 12:00:27 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 12:00:27 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 12:10:24 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:10:24 26 มีนาคม 2561 :try to logon with: GS1WS 12:13:57 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:13:57 26 มีนาคม 2561 :try to logon with: GS1WS 12:22:46 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:22:46 26 มีนาคม 2561 :try to logon with: GS1WS 12:27:06 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:27:06 26 มีนาคม 2561 :try to logon with: GS1WS 12:44:09 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:44:09 26 มีนาคม 2561 :try to logon with: GS1WS 12:44:40 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:44:40 26 มีนาคม 2561 :try to logon with: GS1WS 12:45:52 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:45:52 26 มีนาคม 2561 :try to logon with: GS1WS 12:51:35 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:51:35 26 มีนาคม 2561 :try to logon with: GS1WS 13:00:48 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:00:48 26 มีนาคม 2561 :try to logon with: GS1WS 13:00:48 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 13:00:48 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 13:02:40 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:02:40 26 มีนาคม 2561 :try to logon with: GS1WS 13:05:51 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:05:51 26 มีนาคม 2561 :try to logon with: GS1WS 13:06:36 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:06:36 26 มีนาคม 2561 :try to logon with: GS1WS 13:07:43 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:07:43 26 มีนาคม 2561 :try to logon with: GS1WS 13:08:06 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:08:06 26 มีนาคม 2561 :try to logon with: GS1WS 13:08:36 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:08:36 26 มีนาคม 2561 :try to logon with: GS1WS 13:08:52 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:08:52 26 มีนาคม 2561 :try to logon with: GS1WS 13:09:34 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:09:34 26 มีนาคม 2561 :try to logon with: GS1WS 13:09:47 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:09:47 26 มีนาคม 2561 :try to logon with: GS1WS 13:09:47 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:09:47 26 มีนาคม 2561 :try to logon with: GS1WS 13:09:57 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:09:57 26 มีนาคม 2561 :try to logon with: GS1WS 13:10:53 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:10:53 26 มีนาคม 2561 :try to logon with: GS1WS 13:13:06 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:13:06 26 มีนาคม 2561 :try to logon with: GS1WS 13:18:20 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:18:20 26 มีนาคม 2561 :try to logon with: GS1WS 13:22:08 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:22:08 26 มีนาคม 2561 :try to logon with: GS1WS 13:22:14 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:22:14 26 มีนาคม 2561 :try to logon with: GS1WS 13:22:21 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:22:21 26 มีนาคม 2561 :try to logon with: GS1WS 13:22:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:22:26 26 มีนาคม 2561 :try to logon with: GS1WS 13:22:49 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:22:49 26 มีนาคม 2561 :try to logon with: GS1WS 13:22:55 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:22:55 26 มีนาคม 2561 :try to logon with: GS1WS 13:23:00 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:23:00 26 มีนาคม 2561 :try to logon with: GS1WS 13:49:44 26 มีนาคม 2561 :Server was unable to process request. ---> Cannot open database "RDtmp" requested by the login. The login failed. 13:54:36 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:54:36 26 มีนาคม 2561 :try to logon with: GS1WS 13:57:22 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:57:22 26 มีนาคม 2561 :try to logon with: GS1WS 14:00:25 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:00:25 26 มีนาคม 2561 :try to logon with: GS1WS 14:00:25 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 14:00:25 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 14:05:02 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:05:02 26 มีนาคม 2561 :try to logon with: GS1WS 14:09:23 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:09:23 26 มีนาคม 2561 :try to logon with: GS1WS 14:28:31 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:28:31 26 มีนาคม 2561 :try to logon with: GS1WS 14:29:56 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:29:56 26 มีนาคม 2561 :try to logon with: GS1WS 14:48:08 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:48:08 26 มีนาคม 2561 :try to logon with: GS1WS 14:50:10 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:50:10 26 มีนาคม 2561 :try to logon with: GS1WS 14:52:02 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:52:02 26 มีนาคม 2561 :try to logon with: GS1WS 14:52:24 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:52:24 26 มีนาคม 2561 :try to logon with: GS1WS 14:54:44 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:54:44 26 มีนาคม 2561 :try to logon with: GS1WS 14:57:35 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:57:35 26 มีนาคม 2561 :try to logon with: GS1WS 14:58:55 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:58:55 26 มีนาคม 2561 :try to logon with: GS1WS 14:59:59 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:59:59 26 มีนาคม 2561 :try to logon with: GS1WS 15:00:25 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:00:25 26 มีนาคม 2561 :try to logon with: GS1WS 15:00:25 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 15:00:25 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 15:00:53 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:00:53 26 มีนาคม 2561 :try to logon with: GS1WS 15:01:37 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:01:37 26 มีนาคม 2561 :try to logon with: GS1WS 15:02:34 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:02:34 26 มีนาคม 2561 :try to logon with: GS1WS 15:02:39 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:02:39 26 มีนาคม 2561 :try to logon with: GS1WS 15:03:03 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:03:03 26 มีนาคม 2561 :try to logon with: GS1WS 15:04:07 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:04:07 26 มีนาคม 2561 :try to logon with: GS1WS 15:08:01 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:08:01 26 มีนาคม 2561 :try to logon with: GS1WS 15:11:00 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:11:00 26 มีนาคม 2561 :try to logon with: GS1WS 15:11:06 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:11:06 26 มีนาคม 2561 :try to logon with: GS1WS 15:11:27 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:11:27 26 มีนาคม 2561 :try to logon with: GS1WS 15:13:14 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:13:14 26 มีนาคม 2561 :try to logon with: GS1WS 15:14:38 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:14:38 26 มีนาคม 2561 :try to logon with: GS1WS 15:16:03 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:16:03 26 มีนาคม 2561 :try to logon with: GS1WS 15:16:19 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:16:19 26 มีนาคม 2561 :try to logon with: GS1WS 15:16:29 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:16:29 26 มีนาคม 2561 :try to logon with: GS1WS 15:17:00 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:17:00 26 มีนาคม 2561 :try to logon with: GS1WS 15:18:19 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:18:19 26 มีนาคม 2561 :try to logon with: GS1WS 15:18:55 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:18:55 26 มีนาคม 2561 :try to logon with: GS1WS 15:19:30 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:19:30 26 มีนาคม 2561 :try to logon with: GS1WS 15:21:34 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:21:34 26 มีนาคม 2561 :try to logon with: GS1WS 15:22:52 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:22:52 26 มีนาคม 2561 :try to logon with: GS1WS 15:23:01 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:23:01 26 มีนาคม 2561 :try to logon with: GS1WS 15:23:14 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:23:14 26 มีนาคม 2561 :try to logon with: GS1WS 15:23:27 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:23:27 26 มีนาคม 2561 :try to logon with: GS1WS 15:24:19 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:24:19 26 มีนาคม 2561 :try to logon with: GS1WS 15:24:51 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:24:51 26 มีนาคม 2561 :try to logon with: GS1WS 15:25:13 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:25:13 26 มีนาคม 2561 :try to logon with: GS1WS 15:25:45 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:25:45 26 มีนาคม 2561 :try to logon with: GS1WS 15:26:13 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:26:13 26 มีนาคม 2561 :try to logon with: GS1WS 15:26:21 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:26:21 26 มีนาคม 2561 :try to logon with: GS1WS 15:26:30 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:26:30 26 มีนาคม 2561 :try to logon with: GS1WS 15:26:47 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:26:47 26 มีนาคม 2561 :try to logon with: GS1WS 15:27:07 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:27:07 26 มีนาคม 2561 :try to logon with: GS1WS 15:29:45 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:29:45 26 มีนาคม 2561 :try to logon with: GS1WS 15:33:18 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:33:18 26 มีนาคม 2561 :try to logon with: GS1WS 15:34:49 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:34:49 26 มีนาคม 2561 :try to logon with: GS1WS 15:46:08 26 มีนาคม 2561 :Server was unable to process request. ---> Cannot open database "RDtmp" requested by the login. The login failed. 15:52:39 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:52:39 26 มีนาคม 2561 :try to logon with: GS1WS 15:58:03 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:58:03 26 มีนาคม 2561 :try to logon with: GS1WS 16:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 16:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 16:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 16:23:02 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:23:02 26 มีนาคม 2561 :try to logon with: GS1WS 16:30:00 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:30:00 26 มีนาคม 2561 :try to logon with: GS1WS 16:47:03 26 มีนาคม 2561 :Server was unable to process request. ---> Cannot open database "RDtmp" requested by the login. The login failed. 17:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 17:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 17:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 17:18:15 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:18:15 26 มีนาคม 2561 :try to logon with: GS1WS 17:20:35 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:20:35 26 มีนาคม 2561 :try to logon with: GS1WS 17:25:13 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:25:13 26 มีนาคม 2561 :try to logon with: GS1WS 17:27:46 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:27:46 26 มีนาคม 2561 :try to logon with: GS1WS 17:28:00 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:28:00 26 มีนาคม 2561 :try to logon with: GS1WS 17:35:35 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:35:35 26 มีนาคม 2561 :try to logon with: GS1WS 17:35:52 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:35:52 26 มีนาคม 2561 :try to logon with: GS1WS 17:41:42 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:41:42 26 มีนาคม 2561 :try to logon with: GS1WS 17:42:08 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:42:08 26 มีนาคม 2561 :try to logon with: GS1WS 17:42:48 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:42:48 26 มีนาคม 2561 :try to logon with: GS1WS 17:43:02 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:43:02 26 มีนาคม 2561 :try to logon with: GS1WS 17:44:32 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:44:32 26 มีนาคม 2561 :try to logon with: GS1WS 17:44:35 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:44:35 26 มีนาคม 2561 :try to logon with: GS1WS 17:55:25 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:55:25 26 มีนาคม 2561 :try to logon with: GS1WS 18:00:25 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:00:25 26 มีนาคม 2561 :try to logon with: GS1WS 18:00:25 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 18:00:25 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 19:00:25 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 19:00:25 26 มีนาคม 2561 :try to logon with: GS1WS 19:00:25 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 19:00:25 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 20:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 20:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 20:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 20:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 21:00:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 21:00:26 26 มีนาคม 2561 :try to logon with: GS1WS 21:00:26 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 21:00:26 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 22:00:25 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:00:25 26 มีนาคม 2561 :try to logon with: GS1WS 22:00:25 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 22:00:25 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 22:17:14 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:17:14 26 มีนาคม 2561 :try to logon with: GS1WS 22:21:29 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:21:29 26 มีนาคม 2561 :try to logon with: GS1WS 22:24:09 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:24:09 26 มีนาคม 2561 :try to logon with: GS1WS 22:25:11 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:25:11 26 มีนาคม 2561 :try to logon with: GS1WS 22:25:58 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:25:58 26 มีนาคม 2561 :try to logon with: GS1WS 22:27:33 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:27:33 26 มีนาคม 2561 :try to logon with: GS1WS 22:28:50 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:28:50 26 มีนาคม 2561 :try to logon with: GS1WS 22:29:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:29:26 26 มีนาคม 2561 :try to logon with: GS1WS 22:29:44 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:29:44 26 มีนาคม 2561 :try to logon with: GS1WS 22:35:04 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:35:04 26 มีนาคม 2561 :try to logon with: GS1WS 22:38:11 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:38:11 26 มีนาคม 2561 :try to logon with: GS1WS 22:39:09 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:39:09 26 มีนาคม 2561 :try to logon with: GS1WS 22:39:53 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:39:53 26 มีนาคม 2561 :try to logon with: GS1WS 22:40:32 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:40:32 26 มีนาคม 2561 :try to logon with: GS1WS 22:41:05 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:41:05 26 มีนาคม 2561 :try to logon with: GS1WS 22:41:38 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:41:38 26 มีนาคม 2561 :try to logon with: GS1WS 22:42:30 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:42:30 26 มีนาคม 2561 :try to logon with: GS1WS 22:42:41 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:42:41 26 มีนาคม 2561 :try to logon with: GS1WS 22:42:57 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:42:57 26 มีนาคม 2561 :try to logon with: GS1WS 22:43:58 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:43:58 26 มีนาคม 2561 :try to logon with: GS1WS 22:44:22 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:44:22 26 มีนาคม 2561 :try to logon with: GS1WS 22:48:17 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:48:17 26 มีนาคม 2561 :try to logon with: GS1WS 22:48:49 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:48:49 26 มีนาคม 2561 :try to logon with: GS1WS 22:50:49 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:50:49 26 มีนาคม 2561 :try to logon with: GS1WS 22:54:44 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:54:44 26 มีนาคม 2561 :try to logon with: GS1WS 22:56:09 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:56:09 26 มีนาคม 2561 :try to logon with: GS1WS 22:56:59 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:56:59 26 มีนาคม 2561 :try to logon with: GS1WS 23:00:25 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:00:25 26 มีนาคม 2561 :try to logon with: GS1WS 23:00:25 26 มีนาคม 2561 :getGS1changed=/*SELECT MB_MEMBER.MEMBER_CODE, MB_PRENAME.PRENAME_TH, MB_COMP_PERSON.COMP_PERSON_NAME_TH, MB_PRENAME.PRENAME_EN, MB_COMP_PERSON.COMP_PERSON_NAME_EN, MB_COMP_PERSON.TAX_ID, MB_MEMBER.REGIST_DATE, MB_MEMBER.MEMBER_MAIN_TYPE_CODE, MB_MEMBER.MEMBER_TYPE_CODE, MB_MEMBER.MEMBER_STATUS_CODE, MB_MEMBER_RETIRE.APPROVE_DATE FROM MB_MEMBER INNER JOIN MB_COMP_PERSON ON MB_MEMBER.COMP_PERSON_CODE = MB_COMP_PERSON.COMP_PERSON_CODE INNER JOIN MB_MEMBER_RETIRE ON MB_MEMBER.REGIST_CODE = MB_MEMBER_RETIRE.REGIST_CODE LEFT OUTER JOIN MB_PRENAME ON MB_COMP_PERSON.PREN_CODE = MB_PRENAME.PRENAME_CODE WHERE (MB_MEMBER.MEMBER_MAIN_GROUP_CODE = '300') AND (MB_MEMBER_RETIRE.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) ORDER BY MB_MEMBER_RETIRE.APPROVE_DATE*/ --declare @YYYYMMDD_FROM varchar(max) = '20171101' --declare @YYYYMMDD_TO varchar(max) = '20171201' create table tempWsGs1_001 ( id int, tax_id varchar(max) ) create table tempWsGs1_002 ( MEMBER_CODE varchar(max) , TAX_ID varchar(max) , BDB_CODE varchar(max) , MEMBER_MAIN_TYPE_CODE varchar(max) , MEMBER_MAIN_TYPE_NAME varchar(max) , MEMBER_TYPE_CODE varchar(max) , MEMBER_TYPE_NAME varchar(max) , BUSSINESS_TYPE_TH varchar(max) , BUSSINESS_TYPE_EN varchar(max) , PRENAME_TH varchar(max) , COMP_PERSON_NAME_TH varchar(max) , PRENAME_EN varchar(max) , COMP_PERSON_NAME_EN varchar(max) , ADDR_TH varchar(max) , ADDR_EN varchar(max) , ZIP_CODE_TH varchar(max) , ZIP_CODE_EN varchar(max) , TELEPHONE_TH varchar(max) , TELEPHONE_EN varchar(max) , EMAIL_TH varchar(max) , EMAIL_EN varchar(max) , STATUS varchar(max) , REGIST_DATE varchar(max) , MEMBER_DATE varchar(max) , UPDATE_DATE varchar(max) , CompanyPrefix varchar(max) ) insert into tempWsGs1_001 select distinct ROW_NUMBER() over (order by r.approve_date) as id, c.TAX_ID as tax_id from MB_MEMBER m,MB_COMP_PERSON c,MB_MEMBER_RETIRE r where r.REGIST_CODE=m.REGIST_CODE and m.MEMBER_MAIN_GROUP_CODE='300' and m.COMP_PERSON_CODE=c.COMP_PERSON_CODE AND (r.APPROVE_DATE BETWEEN dbo.fnc_StrToDateTime(@YYYYMMDD_FROM + '000000') AND dbo.fnc_StrToDateTime(@YYYYMMDD_TO + '235959')) declare @id int declare @totalRows int = (select count(*) from tempWsGs1_001) declare @currentRow int = 0 declare @BussinessTypeTH VARCHAR(max) declare @BussinessTypeEN VARCHAR(max) while @currentRow < @totalRows begin set @id = @currentRow+1 declare @TAX_ID varchar(max) set @TAX_ID = (select top 1 tax_id from tempWsGs1_001 where id=@id) insert into tempWsGs1_002 select * from fnc_GetGS1MemberInfoForWebServiceByTaxID(@TAX_ID) set @currentRow = @currentRow +1 end drop table tempWsGs1_001 select * from tempWsGs1_002 drop table tempWsGs1_002 23:00:25 26 มีนาคม 2561 :There is already an object named 'tempWsGs1_001' in the database. 23:00:50 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:00:50 26 มีนาคม 2561 :try to logon with: GS1WS 23:01:22 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:01:22 26 มีนาคม 2561 :try to logon with: GS1WS 23:01:47 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:01:47 26 มีนาคม 2561 :try to logon with: GS1WS 23:01:58 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:01:58 26 มีนาคม 2561 :try to logon with: GS1WS 23:03:15 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:03:15 26 มีนาคม 2561 :try to logon with: GS1WS 23:06:58 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:06:58 26 มีนาคม 2561 :try to logon with: GS1WS 23:07:38 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:07:38 26 มีนาคม 2561 :try to logon with: GS1WS 23:08:10 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:08:10 26 มีนาคม 2561 :try to logon with: GS1WS 23:08:42 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:08:42 26 มีนาคม 2561 :try to logon with: GS1WS 23:09:08 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:09:08 26 มีนาคม 2561 :try to logon with: GS1WS 23:09:26 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:09:26 26 มีนาคม 2561 :try to logon with: GS1WS 23:09:42 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:09:42 26 มีนาคม 2561 :try to logon with: GS1WS 23:12:20 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:12:20 26 มีนาคม 2561 :try to logon with: GS1WS 23:25:03 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:25:03 26 มีนาคม 2561 :try to logon with: GS1WS 23:25:19 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:25:19 26 มีนาคม 2561 :try to logon with: GS1WS 23:25:32 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:25:32 26 มีนาคม 2561 :try to logon with: GS1WS 23:26:03 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:26:03 26 มีนาคม 2561 :try to logon with: GS1WS 23:26:20 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:26:20 26 มีนาคม 2561 :try to logon with: GS1WS 23:26:45 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:26:45 26 มีนาคม 2561 :try to logon with: GS1WS 23:27:18 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:27:18 26 มีนาคม 2561 :try to logon with: GS1WS 23:27:33 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:27:33 26 มีนาคม 2561 :try to logon with: GS1WS 23:28:20 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:28:20 26 มีนาคม 2561 :try to logon with: GS1WS 23:32:33 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:32:33 26 มีนาคม 2561 :try to logon with: GS1WS 23:33:51 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:33:51 26 มีนาคม 2561 :try to logon with: GS1WS 23:34:13 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:34:13 26 มีนาคม 2561 :try to logon with: GS1WS 23:37:38 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:37:38 26 มีนาคม 2561 :try to logon with: GS1WS 23:40:40 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:40:40 26 มีนาคม 2561 :try to logon with: GS1WS 23:41:06 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:41:06 26 มีนาคม 2561 :try to logon with: GS1WS 23:43:05 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:43:05 26 มีนาคม 2561 :try to logon with: GS1WS 23:43:22 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:43:22 26 มีนาคม 2561 :try to logon with: GS1WS 23:43:32 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:43:32 26 มีนาคม 2561 :try to logon with: GS1WS 23:43:56 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:43:56 26 มีนาคม 2561 :try to logon with: GS1WS 23:44:13 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:44:13 26 มีนาคม 2561 :try to logon with: GS1WS 23:44:24 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:44:24 26 มีนาคม 2561 :try to logon with: GS1WS 23:44:44 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:44:44 26 มีนาคม 2561 :try to logon with: GS1WS 23:46:32 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:46:32 26 มีนาคม 2561 :try to logon with: GS1WS 23:47:05 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:47:05 26 มีนาคม 2561 :try to logon with: GS1WS 23:47:37 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:47:37 26 มีนาคม 2561 :try to logon with: GS1WS 23:47:45 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:47:45 26 มีนาคม 2561 :try to logon with: GS1WS 23:49:18 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:49:18 26 มีนาคม 2561 :try to logon with: GS1WS 23:49:55 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:49:55 26 มีนาคม 2561 :try to logon with: GS1WS 23:50:19 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:50:19 26 มีนาคม 2561 :try to logon with: GS1WS 23:50:30 26 มีนาคม 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:50:30 26 มีนาคม 2561 :try to logon with: GS1WS