Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.
INSERT INTO DMFVENDORADDRESSENTITY2 SELECT 'Delivery' as [AddressName] ,VMCTRY as [CountryRegionId] ,'Delivery'as [LocationRole] ,VMNO as [VendAccountNum] ,ISNULL(VMADR1,' ' ) as [Address] ,' ' as [AddressEmail] ,ISNULL(VMPFXN,' ') as [AddressFax] ,ISNULL(VMPPHN,' ') as [AddressPhone] ,' ' as [AddressTelexName] ,' ' as [AddressUrl] ,'URL' as [AddressUrlName] ,(RTRIM(VMADR1) +' '+ RTRIM(LTRIM(VMADR2))) AS DeliveryAddress ,ISNULL(SUBSTRING(VMADR3, 1, CHARINDEX(' ',REVERSE(VMADR3), 14)), ' ') AS [City] ,VMCOUN as [County] ,CASE WHEN VMADR3_start_of_state < 2 THEN '' ELSE SUBSTRING(VMADR3, VMADR3_start_of_state, 2) END AS [STATE] ,VMPZIP as [ZipCode] FROM OPENQUERY (KBM400MFG, ' SELECT ,VMCTRY ,VMNO ,VMADR1 ,VMPFXN ,VMPPHN ,VMADR2 ,VMADR3 ,VMCOUN ,VMPZIP FROM [KBM400MFG].[FLVENDM] ' ) CROSS APPLY (SELECT PATINDEX('%[ ][A-Z][A-Z] %', [VMADR3] + ' ') + 1 AS VMADR3_start_of_state) AS StateFinder
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
13 Experts available now in Live!