url.go must = "go" to continue. SELECT d.skuid, d.dstid, rtrim(s.sku) AS Sku, rtrim(d.sku) AS distributorSku, s.OwnerID, s.FSL_TableCode, cdr_dstparentco , CoType = CASE When cdr_dstparentco > 0 then 'PDST' ELSE 'DST' END FROM tbl_PRD_DistributorSkus d, tbl_PRD_Skus s, tbl_CDR_Distributors cdr WHERE d.skuid = s.skuid AND s.OwnerID = cdr.OwnerID AND s.FSL_TableCode = cdr.FSL_TableCode AND d.dstid = cdr_recordID -- AND rtrim(s.sku) = rtrim(d.sku) -- AND rtrim(s.sku) <> rtrim(d.sku) select customerid from tbl_PRD_CustomerSkus where ownerid = #get_distributorSku.OwnerID# and fsl_tablecode = '#get_distributorSku.FSL_TableCode#' and sku = '#get_distributorSku.Sku#' and customerid = #get_distributorSku.dstid# and customerType = '#get_distributorSku.CoType#' INSERT INTO tbl_PRD_CustomerSkus(OwnerID, FSL_TableCode, Sku, CustomerID, CustomerType, CustomerSku) VALUES(#get_distributorSku.OwnerID#, '#get_distributorSku.FSL_TableCode#', '#get_distributorSku.Sku#', #get_distributorSku.dstid#, '#get_distributorSku.CoType#', '#get_distributorSku.distributorSku#') SELECT Max(CustomerKey) AS CustomerKey FROM tbl_PRD_CustomerSkus c WHERE c.OwnerID = AND c.FSL_TableCode = AND c.CustomerID = AND c.CustomerType = AND c.CustomerSku = INSERT INTO tbl_PRD_CustomerLocales(CustomerKey, ChildID) VALUES (, );