0:00:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 0:00:21 5 เมษายน 2561 :try to logon with: GS1WS 0:00:21 5 เมษายน 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:21 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 1:00:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:00:21 5 เมษายน 2561 :try to logon with: GS1WS 1:00:21 5 เมษายน 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:21 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 1:23:19 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:23:19 5 เมษายน 2561 :try to logon with: GS1WS 1:47:52 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:47:52 5 เมษายน 2561 :try to logon with: GS1WS 1:50:41 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:50:41 5 เมษายน 2561 :try to logon with: GS1WS 1:55:10 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:55:10 5 เมษายน 2561 :try to logon with: GS1WS 1:55:25 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:55:25 5 เมษายน 2561 :try to logon with: GS1WS 1:59:34 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 1:59:34 5 เมษายน 2561 :try to logon with: GS1WS 2:00:25 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 2:00:25 5 เมษายน 2561 :try to logon with: GS1WS 2:00:25 5 เมษายน 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:25 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 3:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 3:00:20 5 เมษายน 2561 :try to logon with: GS1WS 3:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 4:00:22 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 4:00:22 5 เมษายน 2561 :try to logon with: GS1WS 4:00:22 5 เมษายน 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:22 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 5:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 5:00:20 5 เมษายน 2561 :try to logon with: GS1WS 5:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 6:00:26 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 6:00:26 5 เมษายน 2561 :try to logon with: GS1WS 6:00:26 5 เมษายน 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 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 7:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 7:00:20 5 เมษายน 2561 :try to logon with: GS1WS 7:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 8:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:00:20 5 เมษายน 2561 :try to logon with: GS1WS 8:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 8:39:41 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:39:41 5 เมษายน 2561 :try to logon with: GS1WS 8:41:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:41:20 5 เมษายน 2561 :try to logon with: GS1WS 8:42:58 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:42:58 5 เมษายน 2561 :try to logon with: GS1WS 8:44:28 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:44:28 5 เมษายน 2561 :try to logon with: GS1WS 8:46:32 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:46:32 5 เมษายน 2561 :try to logon with: GS1WS 8:48:14 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:48:14 5 เมษายน 2561 :try to logon with: GS1WS 8:49:41 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:49:41 5 เมษายน 2561 :try to logon with: GS1WS 8:52:08 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:52:08 5 เมษายน 2561 :try to logon with: GS1WS 8:53:40 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:53:40 5 เมษายน 2561 :try to logon with: GS1WS 8:55:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:55:21 5 เมษายน 2561 :try to logon with: GS1WS 8:57:03 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:57:03 5 เมษายน 2561 :try to logon with: GS1WS 8:58:35 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 8:58:35 5 เมษายน 2561 :try to logon with: GS1WS 9:00:09 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:00:09 5 เมษายน 2561 :try to logon with: GS1WS 9:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:00:20 5 เมษายน 2561 :try to logon with: GS1WS 9:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 9:02:04 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:02:04 5 เมษายน 2561 :try to logon with: GS1WS 9:14:24 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:14:24 5 เมษายน 2561 :try to logon with: GS1WS 9:16:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:16:56 5 เมษายน 2561 :try to logon with: GS1WS 9:19:06 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:19:06 5 เมษายน 2561 :try to logon with: GS1WS 9:20:59 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:20:59 5 เมษายน 2561 :try to logon with: GS1WS 9:24:07 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:24:07 5 เมษายน 2561 :try to logon with: GS1WS 9:25:34 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:25:34 5 เมษายน 2561 :try to logon with: GS1WS 9:27:05 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:27:05 5 เมษายน 2561 :try to logon with: GS1WS 9:28:43 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:28:43 5 เมษายน 2561 :try to logon with: GS1WS 9:30:00 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:30:00 5 เมษายน 2561 :try to logon with: GS1WS 9:31:17 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:31:17 5 เมษายน 2561 :try to logon with: GS1WS 9:33:28 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:33:28 5 เมษายน 2561 :try to logon with: GS1WS 9:34:17 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:34:17 5 เมษายน 2561 :try to logon with: GS1WS 9:37:50 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:37:50 5 เมษายน 2561 :try to logon with: GS1WS 9:39:10 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:39:10 5 เมษายน 2561 :try to logon with: GS1WS 9:42:16 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:42:16 5 เมษายน 2561 :try to logon with: GS1WS 9:43:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:43:36 5 เมษายน 2561 :try to logon with: GS1WS 9:44:47 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:44:47 5 เมษายน 2561 :try to logon with: GS1WS 9:46:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:46:48 5 เมษายน 2561 :try to logon with: GS1WS 9:48:39 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:48:39 5 เมษายน 2561 :try to logon with: GS1WS 9:49:06 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:49:06 5 เมษายน 2561 :try to logon with: GS1WS 9:49:37 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:49:37 5 เมษายน 2561 :try to logon with: GS1WS 9:50:16 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:50:16 5 เมษายน 2561 :try to logon with: GS1WS 9:51:49 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:51:49 5 เมษายน 2561 :try to logon with: GS1WS 9:53:12 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:53:12 5 เมษายน 2561 :try to logon with: GS1WS 9:54:15 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:54:15 5 เมษายน 2561 :try to logon with: GS1WS 9:54:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:54:21 5 เมษายน 2561 :try to logon with: GS1WS 9:55:02 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:55:02 5 เมษายน 2561 :try to logon with: GS1WS 9:59:37 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 9:59:37 5 เมษายน 2561 :try to logon with: GS1WS 10:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:00:20 5 เมษายน 2561 :try to logon with: GS1WS 10:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 10:09:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:09:56 5 เมษายน 2561 :try to logon with: GS1WS 10:16:15 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:16:15 5 เมษายน 2561 :try to logon with: GS1WS 10:20:32 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:20:32 5 เมษายน 2561 :try to logon with: GS1WS 10:21:50 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:21:50 5 เมษายน 2561 :try to logon with: GS1WS 10:22:50 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:22:50 5 เมษายน 2561 :try to logon with: GS1WS 10:35:29 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:35:29 5 เมษายน 2561 :try to logon with: GS1WS 10:36:11 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:36:11 5 เมษายน 2561 :try to logon with: GS1WS 10:36:47 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:36:47 5 เมษายน 2561 :try to logon with: GS1WS 10:37:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:37:20 5 เมษายน 2561 :try to logon with: GS1WS 10:37:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:37:56 5 เมษายน 2561 :try to logon with: GS1WS 10:38:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:38:36 5 เมษายน 2561 :try to logon with: GS1WS 10:40:00 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:40:00 5 เมษายน 2561 :try to logon with: GS1WS 10:41:01 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:41:01 5 เมษายน 2561 :try to logon with: GS1WS 10:41:44 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:41:44 5 เมษายน 2561 :try to logon with: GS1WS 10:41:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:41:48 5 เมษายน 2561 :try to logon with: GS1WS 10:42:14 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:42:14 5 เมษายน 2561 :try to logon with: GS1WS 10:43:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:43:56 5 เมษายน 2561 :try to logon with: GS1WS 10:44:54 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:44:54 5 เมษายน 2561 :try to logon with: GS1WS 10:45:57 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:45:57 5 เมษายน 2561 :try to logon with: GS1WS 10:47:16 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:47:16 5 เมษายน 2561 :try to logon with: GS1WS 10:47:46 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:47:46 5 เมษายน 2561 :try to logon with: GS1WS 10:48:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:48:36 5 เมษายน 2561 :try to logon with: GS1WS 10:48:45 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:48:45 5 เมษายน 2561 :try to logon with: GS1WS 10:49:23 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:49:23 5 เมษายน 2561 :try to logon with: GS1WS 10:49:53 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:49:53 5 เมษายน 2561 :try to logon with: GS1WS 10:50:38 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:50:38 5 เมษายน 2561 :try to logon with: GS1WS 10:51:50 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:51:50 5 เมษายน 2561 :try to logon with: GS1WS 10:53:00 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:53:00 5 เมษายน 2561 :try to logon with: GS1WS 10:53:19 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:53:19 5 เมษายน 2561 :try to logon with: GS1WS 10:53:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:53:36 5 เมษายน 2561 :try to logon with: GS1WS 10:54:58 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:54:58 5 เมษายน 2561 :try to logon with: GS1WS 10:55:02 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:55:02 5 เมษายน 2561 :try to logon with: GS1WS 10:56:24 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:56:24 5 เมษายน 2561 :try to logon with: GS1WS 10:57:55 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:57:55 5 เมษายน 2561 :try to logon with: GS1WS 10:59:14 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 10:59:14 5 เมษายน 2561 :try to logon with: GS1WS 11:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:00:20 5 เมษายน 2561 :try to logon with: GS1WS 11:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 11:00:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:00:56 5 เมษายน 2561 :try to logon with: GS1WS 11:03:13 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:03:13 5 เมษายน 2561 :try to logon with: GS1WS 11:09:07 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:09:07 5 เมษายน 2561 :try to logon with: GS1WS 11:10:32 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:10:32 5 เมษายน 2561 :try to logon with: GS1WS 11:11:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:11:56 5 เมษายน 2561 :try to logon with: GS1WS 11:13:13 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:13:13 5 เมษายน 2561 :try to logon with: GS1WS 11:15:03 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:15:03 5 เมษายน 2561 :try to logon with: GS1WS 11:16:25 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:16:25 5 เมษายน 2561 :try to logon with: GS1WS 11:17:59 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:17:59 5 เมษายน 2561 :try to logon with: GS1WS 11:20:35 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:20:35 5 เมษายน 2561 :try to logon with: GS1WS 11:29:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:29:48 5 เมษายน 2561 :try to logon with: GS1WS 11:31:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:31:36 5 เมษายน 2561 :try to logon with: GS1WS 11:33:23 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:33:23 5 เมษายน 2561 :try to logon with: GS1WS 11:37:45 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:37:45 5 เมษายน 2561 :try to logon with: GS1WS 11:41:08 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 11:41:08 5 เมษายน 2561 :try to logon with: GS1WS 11:52:03 5 เมษายน 2561 :Server was unable to process request. ---> Cannot open database "RDtmp" requested by the login. The login failed. 12:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:00:20 5 เมษายน 2561 :try to logon with: GS1WS 12:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 12:02:50 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:02:50 5 เมษายน 2561 :try to logon with: GS1WS 12:06:08 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:06:08 5 เมษายน 2561 :try to logon with: GS1WS 12:10:55 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:10:55 5 เมษายน 2561 :try to logon with: GS1WS 12:13:05 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:13:05 5 เมษายน 2561 :try to logon with: GS1WS 12:29:28 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:29:28 5 เมษายน 2561 :try to logon with: GS1WS 12:34:42 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:34:42 5 เมษายน 2561 :try to logon with: GS1WS 12:35:12 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:35:12 5 เมษายน 2561 :try to logon with: GS1WS 12:42:07 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 12:42:07 5 เมษายน 2561 :try to logon with: GS1WS 13:00:24 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:00:24 5 เมษายน 2561 :try to logon with: GS1WS 13:00:24 5 เมษายน 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:24 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 13:22:05 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:22:05 5 เมษายน 2561 :try to logon with: GS1WS 13:42:13 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:42:13 5 เมษายน 2561 :try to logon with: GS1WS 13:44:07 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:44:07 5 เมษายน 2561 :try to logon with: GS1WS 13:46:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:46:21 5 เมษายน 2561 :try to logon with: GS1WS 13:48:14 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:48:14 5 เมษายน 2561 :try to logon with: GS1WS 13:49:31 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:49:31 5 เมษายน 2561 :try to logon with: GS1WS 13:53:12 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:53:12 5 เมษายน 2561 :try to logon with: GS1WS 13:54:18 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:54:18 5 เมษายน 2561 :try to logon with: GS1WS 13:56:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:56:36 5 เมษายน 2561 :try to logon with: GS1WS 13:58:17 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:58:17 5 เมษายน 2561 :try to logon with: GS1WS 13:59:57 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 13:59:57 5 เมษายน 2561 :try to logon with: GS1WS 14:00:22 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:00:22 5 เมษายน 2561 :try to logon with: GS1WS 14:00:22 5 เมษายน 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:22 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 14:01:33 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:01:33 5 เมษายน 2561 :try to logon with: GS1WS 14:02:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:02:48 5 เมษายน 2561 :try to logon with: GS1WS 14:04:06 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:04:07 5 เมษายน 2561 :try to logon with: GS1WS 14:06:53 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:06:53 5 เมษายน 2561 :try to logon with: GS1WS 14:10:18 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:10:18 5 เมษายน 2561 :try to logon with: GS1WS 14:11:27 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:11:27 5 เมษายน 2561 :try to logon with: GS1WS 14:14:15 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:14:15 5 เมษายน 2561 :try to logon with: GS1WS 14:15:35 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:15:35 5 เมษายน 2561 :try to logon with: GS1WS 14:16:43 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:16:43 5 เมษายน 2561 :try to logon with: GS1WS 14:18:13 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:18:13 5 เมษายน 2561 :try to logon with: GS1WS 14:19:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:19:20 5 เมษายน 2561 :try to logon with: GS1WS 14:20:30 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:20:30 5 เมษายน 2561 :try to logon with: GS1WS 14:22:54 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:22:54 5 เมษายน 2561 :try to logon with: GS1WS 14:24:19 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:24:19 5 เมษายน 2561 :try to logon with: GS1WS 14:28:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:28:56 5 เมษายน 2561 :try to logon with: GS1WS 14:44:09 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:44:09 5 เมษายน 2561 :try to logon with: GS1WS 14:45:39 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:45:39 5 เมษายน 2561 :try to logon with: GS1WS 14:45:49 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:45:49 5 เมษายน 2561 :try to logon with: GS1WS 14:47:30 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:47:30 5 เมษายน 2561 :try to logon with: GS1WS 14:48:45 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:48:45 5 เมษายน 2561 :try to logon with: GS1WS 14:52:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:52:48 5 เมษายน 2561 :try to logon with: GS1WS 14:53:07 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:53:07 5 เมษายน 2561 :try to logon with: GS1WS 14:54:03 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:54:03 5 เมษายน 2561 :try to logon with: GS1WS 14:55:18 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:55:18 5 เมษายน 2561 :try to logon with: GS1WS 14:58:28 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:58:28 5 เมษายน 2561 :try to logon with: GS1WS 14:59:37 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 14:59:37 5 เมษายน 2561 :try to logon with: GS1WS 15:00:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:00:21 5 เมษายน 2561 :try to logon with: GS1WS 15:00:21 5 เมษายน 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:21 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 15:00:58 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:00:58 5 เมษายน 2561 :try to logon with: GS1WS 15:04:13 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:04:13 5 เมษายน 2561 :try to logon with: GS1WS 15:04:38 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:04:38 5 เมษายน 2561 :try to logon with: GS1WS 15:05:34 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:05:34 5 เมษายน 2561 :try to logon with: GS1WS 15:11:42 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:11:42 5 เมษายน 2561 :try to logon with: GS1WS 15:12:06 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:12:06 5 เมษายน 2561 :try to logon with: GS1WS 15:12:25 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:12:25 5 เมษายน 2561 :try to logon with: GS1WS 15:18:06 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:18:06 5 เมษายน 2561 :try to logon with: GS1WS 15:19:31 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:19:31 5 เมษายน 2561 :try to logon with: GS1WS 15:20:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:20:48 5 เมษายน 2561 :try to logon with: GS1WS 15:27:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:27:21 5 เมษายน 2561 :try to logon with: GS1WS 15:28:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:28:36 5 เมษายน 2561 :try to logon with: GS1WS 15:28:55 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:28:55 5 เมษายน 2561 :try to logon with: GS1WS 15:29:19 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:29:19 5 เมษายน 2561 :try to logon with: GS1WS 15:30:26 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:30:26 5 เมษายน 2561 :try to logon with: GS1WS 15:30:53 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:30:53 5 เมษายน 2561 :try to logon with: GS1WS 15:34:44 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:34:44 5 เมษายน 2561 :try to logon with: GS1WS 15:35:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:35:21 5 เมษายน 2561 :try to logon with: GS1WS 15:36:36 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:36:36 5 เมษายน 2561 :try to logon with: GS1WS 15:38:03 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:38:03 5 เมษายน 2561 :try to logon with: GS1WS 15:39:01 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:39:01 5 เมษายน 2561 :try to logon with: GS1WS 15:39:11 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:39:11 5 เมษายน 2561 :try to logon with: GS1WS 15:40:22 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:40:22 5 เมษายน 2561 :try to logon with: GS1WS 15:41:46 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:41:46 5 เมษายน 2561 :try to logon with: GS1WS 15:44:24 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:44:24 5 เมษายน 2561 :try to logon with: GS1WS 15:45:03 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:45:03 5 เมษายน 2561 :try to logon with: GS1WS 15:45:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:45:48 5 เมษายน 2561 :try to logon with: GS1WS 15:48:03 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:48:03 5 เมษายน 2561 :try to logon with: GS1WS 15:50:12 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:50:12 5 เมษายน 2561 :try to logon with: GS1WS 15:51:00 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:51:00 5 เมษายน 2561 :try to logon with: GS1WS 15:55:17 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:55:17 5 เมษายน 2561 :try to logon with: GS1WS 15:56:03 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:56:03 5 เมษายน 2561 :try to logon with: GS1WS 15:59:02 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 15:59:02 5 เมษายน 2561 :try to logon with: GS1WS 16:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:00:20 5 เมษายน 2561 :try to logon with: GS1WS 16:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 16:00:42 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:00:42 5 เมษายน 2561 :try to logon with: GS1WS 16:02:02 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:02:02 5 เมษายน 2561 :try to logon with: GS1WS 16:04:22 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:04:22 5 เมษายน 2561 :try to logon with: GS1WS 16:05:58 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:05:58 5 เมษายน 2561 :try to logon with: GS1WS 16:07:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:07:48 5 เมษายน 2561 :try to logon with: GS1WS 16:10:04 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:10:04 5 เมษายน 2561 :try to logon with: GS1WS 16:13:17 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:13:17 5 เมษายน 2561 :try to logon with: GS1WS 16:14:29 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:14:29 5 เมษายน 2561 :try to logon with: GS1WS 16:15:40 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:15:40 5 เมษายน 2561 :try to logon with: GS1WS 16:38:00 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:38:00 5 เมษายน 2561 :try to logon with: GS1WS 16:38:23 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:38:23 5 เมษายน 2561 :try to logon with: GS1WS 16:39:31 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:39:31 5 เมษายน 2561 :try to logon with: GS1WS 16:54:37 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:54:37 5 เมษายน 2561 :try to logon with: GS1WS 16:57:25 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:57:25 5 เมษายน 2561 :try to logon with: GS1WS 16:59:38 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 16:59:38 5 เมษายน 2561 :try to logon with: GS1WS 17:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:00:20 5 เมษายน 2561 :try to logon with: GS1WS 17:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 17:04:42 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:04:42 5 เมษายน 2561 :try to logon with: GS1WS 17:07:13 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:07:13 5 เมษายน 2561 :try to logon with: GS1WS 17:27:09 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:27:09 5 เมษายน 2561 :try to logon with: GS1WS 17:30:09 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:30:09 5 เมษายน 2561 :try to logon with: GS1WS 17:34:55 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:34:55 5 เมษายน 2561 :try to logon with: GS1WS 17:37:49 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:37:49 5 เมษายน 2561 :try to logon with: GS1WS 17:38:44 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:38:44 5 เมษายน 2561 :try to logon with: GS1WS 17:39:35 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:39:35 5 เมษายน 2561 :try to logon with: GS1WS 17:43:42 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:43:42 5 เมษายน 2561 :try to logon with: GS1WS 17:46:41 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:46:41 5 เมษายน 2561 :try to logon with: GS1WS 17:46:55 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:46:55 5 เมษายน 2561 :try to logon with: GS1WS 17:48:40 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:48:40 5 เมษายน 2561 :try to logon with: GS1WS 17:50:27 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:50:27 5 เมษายน 2561 :try to logon with: GS1WS 17:53:56 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:53:56 5 เมษายน 2561 :try to logon with: GS1WS 17:55:47 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:55:47 5 เมษายน 2561 :try to logon with: GS1WS 17:57:28 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:57:28 5 เมษายน 2561 :try to logon with: GS1WS 17:59:13 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 17:59:13 5 เมษายน 2561 :try to logon with: GS1WS 18:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:00:20 5 เมษายน 2561 :try to logon with: GS1WS 18:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 18:16:04 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:16:04 5 เมษายน 2561 :try to logon with: GS1WS 18:22:45 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:22:45 5 เมษายน 2561 :try to logon with: GS1WS 18:24:21 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:24:21 5 เมษายน 2561 :try to logon with: GS1WS 18:26:09 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:26:09 5 เมษายน 2561 :try to logon with: GS1WS 18:26:55 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:26:55 5 เมษายน 2561 :try to logon with: GS1WS 18:27:45 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:27:45 5 เมษายน 2561 :try to logon with: GS1WS 18:28:58 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:28:58 5 เมษายน 2561 :try to logon with: GS1WS 18:29:48 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:29:48 5 เมษายน 2561 :try to logon with: GS1WS 18:31:55 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:31:55 5 เมษายน 2561 :try to logon with: GS1WS 18:33:35 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 18:33:35 5 เมษายน 2561 :try to logon with: GS1WS 19:00:26 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 19:00:26 5 เมษายน 2561 :try to logon with: GS1WS 19:00:26 5 เมษายน 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:26 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 20:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 20:00:20 5 เมษายน 2561 :try to logon with: GS1WS 20:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 21:00:19 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 21:00:19 5 เมษายน 2561 :try to logon with: GS1WS 21:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 22:00:20 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 22:00:20 5 เมษายน 2561 :try to logon with: GS1WS 22:00:20 5 เมษายน 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:20 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database. 23:00:19 5 เมษายน 2561 :Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 23:00:19 5 เมษายน 2561 :try to logon with: GS1WS 23:00:19 5 เมษายน 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:19 5 เมษายน 2561 :There is already an object named 'tempWsGs1_001' in the database.