USE [Arizona]

SELECT
    ou.[OU_subsidiary]
    ,s.[SUB_prefix]
    ,ou.[OU_code]
    ,ou.[OU_short_name]
    ,ws.[WSA_code]
    ,c.[WSAC_url]
--UPDATE c SET [c].[WSAC_url] = 'https://xml.e-galexis.com:10443/POS/'
FROM [dbo].[WSA_connection] c
    JOIN [dbo].[Web_service_access] ws ON ws.[Web_service_access_GUID] = c.[WSAC_web_service_access]
    JOIN [dbo].[Organizational_unit] ou ON ou.[Organizational_unit_ID] = c.[WSAC_organizational_unit]
    JOIN [dbo].[Subsidiary] s ON s.[Subsidiary_ID] = [ou].[OU_subsidiary]
WHERE ou.[OU_code] LIKE '824'
AND [s].[SUB_prefix]='CVI'
AND [ws].[WSA_code] LIKE 'apswsGalexisPurchase'


