Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.
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
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.