NJC__Documentation::DB

dbo.vw_ms_base_part

Description

Properties

Name Value
Collation SQL_Latin1_General_CP1_CI_AS
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Schema Bound

False

Created 9/11/2017 10:03:49
Last Modified 9/11/2017 10:03:49

Columns

Key Name Description
ms_item_base_no
ms_item_base_name
have_report
count_report
list_report
ms_report_car_line_sum_id
info
create_date
create_by
modify_date
modify_by
allow_to_production
mandatory_car_line
allow_to_scrap
allow_to_repair
allow_to_selling
allow_date
allow_by

SQL Script

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
create view dbo.vw_ms_base_part
---XencX---with encryption
as  
SELECT        
 dt_ms_item_base.ms_item_base_no
, dt_ms_item_base.ms_item_base_name
, case when dt_ms_report_car_line_sum.ms_report_car_line_sum_id is not null then 1 else 0 end as have_report
, case when dt_ms_report_car_line_sum.ms_report_car_line_sum_id is not null then 1 else 0 end as count_report
, isnull(dt_ms_report_car_line_sum.ms_report_car_line_sum_name,'') as  list_report 
, isnull( dt_ms_report_car_line_sum.ms_report_car_line_sum_id,-1) as  ms_report_car_line_sum_id 
, dt_ms_item_base.info
, dt_ms_item_base.create_date
, users_modify.username AS create_by
, dt_ms_item_base.modify_date
, users_create.username AS modify_by 
, isnull(dt_ms_item_base_h_allow.allow_to_production,0) as allow_to_production
, case when  isnull(dt_ms_item_base_h_allow.allow_to_production,0) =0 then 0 else isnull( dt_ms_item_base_h_allow.mandatory_car_line,0) end as mandatory_car_line
,isnull( dt_ms_item_base_h_allow.allow_to_scrap,0) as allow_to_scrap
,isnull( dt_ms_item_base_h_allow.allow_to_repair,0) as allow_to_repair
,isnull( dt_ms_item_base_h_allow.allow_to_selling,0) as allow_to_selling
, dt_ms_item_base_h_allow.create_date AS allow_date
, user_allow.username AS allow_by
 

FROM            dt_ms_report_car_line_sum RIGHT OUTER JOIN
                         dt_ms_item_base_h_report_car_line_sum RIGHT OUTER JOIN
                         dt_ms_item_base ON dt_ms_item_base_h_report_car_line_sum.ms_item_base_h_report_car_line_sum_id = dt_ms_item_base.ms_item_base_h_report_car_line_sum_id ON 
                         dt_ms_report_car_line_sum.ms_report_car_line_sum_id = dt_ms_item_base_h_report_car_line_sum.ms_report_car_line_sum_id LEFT OUTER JOIN
                         users AS user_allow INNER JOIN
                         dt_ms_item_base_h_allow ON user_allow.id = dt_ms_item_base_h_allow.create_by ON dt_ms_item_base.ms_item_base_h_allow_id = dt_ms_item_base_h_allow.ms_item_base_h_allow_id LEFT OUTER JOIN
                         users AS users_create ON dt_ms_item_base.create_by = users_create.id LEFT OUTER JOIN
                         users AS users_modify ON dt_ms_item_base.modify_by = users_modify.id
       
GO