USE [AJK]
GO

/****** Object:  View [dbo].[view_custport_user]    Script Date: 19/09/2018 17:42:06 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


ALTER VIEW [dbo].[view_custport_user]
AS
	SELECT 
	   u.[user_id]
      --,u.username
	  ,u.username_login AS username
      ,u.fullname
      ,u.email
      ,u.user_type_code
	  ,ur.description as branch_name
	  ,ur.company_region_id
	  ,ur.company_region_code
	  ,u.is_active as is_active
	FROM 
		dbo.custport_m_user u
		inner join 
		custport_m_user_company uc ON u.username=uc.username
		inner join 
		custport_m_company_region ur ON uc.company_region_code=ur.company_region_code
  




GO


