SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


-- View

CREATE view [dbo].[vw_tt_act_cies_pr]
as

	select	

			ciepr__act_actor_id = act_actor_id,
			ciepr__act_address_id = act_address_id,

			ciepr__adr_name = adr_name,
			ciepr__adr_first_name = adr_first_name,
			ciepr__adr_complete_name = adr_complete_name,
			ciepr__adr_address1 = adr_address1,
			ciepr__adr_address2 = adr_address2,
			ciepr__adr_address3 = adr_address3,
			ciepr__adr_postal_code = adr_postal_code,
			ciepr__adr_city = adr_city,
			ciepr__adr_country_code = adr_country_code,
			ciepr__adr_mail = adr_mail,
			ciepr__adr_home_phone = adr_home_phone,
			ciepr__adr_business_phone = adr_business_phone,
			ciepr__adr_business_phone2 = adr_business_phone2,
			ciepr__adr_mobile_phone = adr_mobile_phone,
			ciepr__adr_fax = adr_fax,
			ciepr__adr_title_code = adr_title_code,

			ciepr__nmtit_l1 = nmtit_l1,
			ciepr__nmtit_l2 = nmtit_l2,
			ciepr__nmtit_l3 = nmtit_l3,

			ciepr__nmtit_short_code_l1 = nmtit_short_code_l1,
			ciepr__nmtit_short_code_l2 = nmtit_short_code_l2,
			ciepr__nmtit_short_code_l3 = nmtit_short_code_l3,

			ciepr__nmctr_l1 = nmctr_l1,
			ciepr__nmctr_l2 = nmctr_l2,
			ciepr__nmctr_l3 = nmctr_l3,

			ciepr__cie_display_name = cie_display_name,
			ciepr__cie_short_code = cie_short_code

	from act_cies
		inner join act_actors on act_actor_id = cie_actor_id
		inner join adr_addresses on adr_address_id = act_address_id 
		left join nm_titles on nmtit_title_code = adr_title_code
		left join nm_countries on nmctr_country_code = adr_country_code




GO
