NJC__Documentation::DB

dbo.dt_ms_item_in_detail

Description

Properties

Name Value
Collation
File Group
Filestream File Group
Is Partitioned

False

Partitioned Column
Partition Scheme
File Groups
Filestream Partition Scheme
Filestream File Groups
Heap

False

Full Text Catalog
Full Text
Compression NONE
Row Count (~) 66699
Created 9/11/2017 09:42:00
Last Modified 7/17/2020 09:06:31

Columns

Key Name Data Type Length Precision Scale Not Null Identity Rule Default Computed Persisted Description
ms_in_item_detail_id bigint 8 19 0

True

1 - 1

False

False

mode_source int 4 10 0

False

False

False

id_source_header bigint 8 19 0

False

False

False

id_source bigint 8 19 0

False

False

False

quantity decimal 17 38 4

False

False

False

quantity_source decimal 17 38 4

False

False

False

ms_item_id bigint 8 19 0

False

False

False

quantity_pakai decimal 17 38 4

False

False

False

create_date datetime 8 23 3

False

False

False

create_by int 4 10 0

False

False

False

modify_date datetime 8 23 3

False

False

False

modify_by int 4 10 0

False

False

False

ori_ms_in_item_detail_id bigint 8 19 0

False

False

False

info varchar 255 0 0

False

False

False

total_amont decimal 17 38 4

False

False

False

total_amont_idr decimal 17 38 4

False

False

False

total_amont_usd decimal 17 38 4

False

False

False

ms_date_business_id int 4 10 0

False

False

False

is_move_business_date bit 1 1 0

False

False

False

is_adjustment bit 1 1 0

False

False

False

ms_date_business_id_from int 4 10 0

False

False

False

ms_item_h_price_id bigint 8 19 0

False

False

False

ms_item_in_move_avg_id bigint 8 19 0

False

False

False

ms_item_out_move_avg_id bigint 8 19 0

False

False

False

Indexes

Key Name Columns Unique Type Description
IX_dt_ms_item_in_detail_2017_11_10_002 ori_ms_in_item_detail_id

False

IX_dt_ms_item_in_detail_2017_11_10_003 ms_item_id

False

IX_dt_ms_item_in_detail_20171024_0001 ms_item_in_move_avg_id, ori_ms_in_item_detail_id, is_adjustment, mode_source, id_source, id_source_header

False

ix_dt_ms_item_in_detail_2018_01_03_001 mode_source, total_amont_idr, total_amont_usd

False

NonClusteredIndex-20200717-090433 quantity

False

NonClusteredIndex-20200717-090449 quantity_source

False

NonClusteredIndex-20200717-090459 quantity_pakai

False

NonClusteredIndex-20200717-090556 mode_source

False

NonClusteredIndex-20200717-090607 id_source_header

False

NonClusteredIndex-20200717-090617 id_source

False

PK_dt_ms_item_in_detail ms_in_item_detail_id

True

Foreign Keys

Name Columns Description
FK_dt_ms_item_in_detail_dt_ms_adj_sto ms_adj_sto_id
FK_dt_ms_item_in_detail_dt_ms_item_daily_in_move_avg ms_item_in_move_avg_id
FK_dt_ms_item_in_detail_dt_ms_item_list_sta ms_item_list_sta_id
FK_dt_ms_item_in_detail_dt_ms_item_out_detail ms_item_out_detail_id
FK_dt_ms_item_in_detail_dt_ms_production_retur ms_production_retur_id
FK_dt_ms_item_in_detail_dt_ms_production_retur_detail ms_production_retur_detail_id
FK_dt_ms_item_in_detail_dt_ms_tpb_in_barang1 ID
FK_dt_ms_item_in_detail_enum_ms_mode_source_item_in_detail mode_source

SQL Script

CREATE TABLE dbo.dt_ms_item_in_detail (
  ms_in_item_detail_id bigint IDENTITY,
  mode_source int NULL,
  id_source_header bigint NULL,
  id_source bigint NULL,
  quantity decimal(38, 4) NULL,
  quantity_source decimal(38, 4) NULL,
  ms_item_id bigint NULL,
  quantity_pakai decimal(38, 4) NULL,
  create_date datetime NULL,
  create_by int NULL,
  modify_date datetime NULL,
  modify_by int NULL,
  ori_ms_in_item_detail_id bigint NULL,
  info varchar(255) NULL,
  total_amont decimal(38, 4) NULL,
  total_amont_idr decimal(38, 4) NULL,
  total_amont_usd decimal(38, 4) NULL,
  ms_date_business_id int NULL,
  is_move_business_date bit NULL,
  is_adjustment bit NULL,
  ms_date_business_id_from int NULL,
  ms_item_h_price_id bigint NULL,
  ms_item_in_move_avg_id bigint NULL,
  ms_item_out_move_avg_id bigint NULL,
  CONSTRAINT PK_dt_ms_item_in_detail PRIMARY KEY CLUSTERED (ms_in_item_detail_id)
)
ON [PRIMARY]
GO

CREATE INDEX IX_dt_ms_item_in_detail_2017_11_10_002
  ON dbo.dt_ms_item_in_detail (ori_ms_in_item_detail_id)
  INCLUDE (ms_in_item_detail_id, total_amont)
  ON [PRIMARY]
GO

CREATE INDEX IX_dt_ms_item_in_detail_2017_11_10_003
  ON dbo.dt_ms_item_in_detail (ms_item_id)
  INCLUDE (ms_in_item_detail_id, mode_source, id_source_header, id_source, quantity_pakai, ori_ms_in_item_detail_id, info)
  ON [PRIMARY]
GO

CREATE INDEX IX_dt_ms_item_in_detail_20171024_0001
  ON dbo.dt_ms_item_in_detail (ms_item_in_move_avg_id, ori_ms_in_item_detail_id, is_adjustment, mode_source, id_source, id_source_header)
  ON [PRIMARY]
GO

CREATE INDEX ix_dt_ms_item_in_detail_2018_01_03_001
  ON dbo.dt_ms_item_in_detail (mode_source, total_amont_idr, total_amont_usd)
  INCLUDE (id_source, quantity_pakai, ms_item_in_move_avg_id)
  ON [PRIMARY]
GO

CREATE INDEX [NonClusteredIndex-20200717-090433]
  ON dbo.dt_ms_item_in_detail (quantity)
  ON [PRIMARY]
GO

CREATE INDEX [NonClusteredIndex-20200717-090449]
  ON dbo.dt_ms_item_in_detail (quantity_source)
  ON [PRIMARY]
GO

CREATE INDEX [NonClusteredIndex-20200717-090459]
  ON dbo.dt_ms_item_in_detail (quantity_pakai)
  ON [PRIMARY]
GO

CREATE INDEX [NonClusteredIndex-20200717-090556]
  ON dbo.dt_ms_item_in_detail (mode_source)
  ON [PRIMARY]
GO

CREATE INDEX [NonClusteredIndex-20200717-090607]
  ON dbo.dt_ms_item_in_detail (id_source_header)
  ON [PRIMARY]
GO

CREATE INDEX [NonClusteredIndex-20200717-090617]
  ON dbo.dt_ms_item_in_detail (id_source)
  ON [PRIMARY]
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_adj_sto FOREIGN KEY (id_source_header) REFERENCES dbo.dt_ms_adj_sto (ms_adj_sto_id) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_adj_sto
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_item_daily_in_move_avg FOREIGN KEY (ms_item_in_move_avg_id) REFERENCES dbo.dt_ms_item_daily_in_move_avg (ms_item_in_move_avg_id) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_item_daily_in_move_avg
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_item_list_sta FOREIGN KEY (id_source) REFERENCES dbo.dt_ms_item_list_sta (ms_item_list_sta_id) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_item_list_sta
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_item_out_detail FOREIGN KEY (id_source) REFERENCES dbo.dt_ms_item_out_detail (ms_item_out_detail_id) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_item_out_detail
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_production_retur FOREIGN KEY (id_source_header) REFERENCES dbo.dt_ms_production_retur (ms_production_retur_id) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_production_retur
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_production_retur_detail FOREIGN KEY (id_source) REFERENCES dbo.dt_ms_production_retur_detail (ms_production_retur_detail_id) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_production_retur_detail
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_tpb_in_barang1 FOREIGN KEY (id_source) REFERENCES dbo.dt_ms_tpb_in_barang (ID) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_dt_ms_tpb_in_barang1
GO

ALTER TABLE dbo.dt_ms_item_in_detail WITH NOCHECK
  ADD CONSTRAINT FK_dt_ms_item_in_detail_enum_ms_mode_source_item_in_detail FOREIGN KEY (mode_source) REFERENCES dbo.enum_ms_mode_source_item_in_detail (mode_source) NOT FOR REPLICATION
GO

ALTER TABLE dbo.dt_ms_item_in_detail
  NOCHECK CONSTRAINT FK_dt_ms_item_in_detail_enum_ms_mode_source_item_in_detail
GO