Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users
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.