with data as ( select sourceId, sourceType, sourceName from tbl_DW_1fsSources#_tableSuffix# s with (nolock) inner join tbl_CHO_Operators c with (nolock) on c.cho_Id = s.sourceId where s.sourceType = 'CHO' and c.cho_type in ( 'G','C' ) ) #forJSON( 'data', attributes.datastore, 'sourceName' )#