Dynamics GP BOM Export – Part 9

Dynamics GP BOM Export  – Part 9

USE [COMPANYDB]
go
/****** Object:  View [dbo].[BOM9]    Script Date: 09/04/2013 19:37:00 ******/
SET ansi_nulls ON
go
SET quoted_identifier ON
go
CREATE VIEW [dbo].[BOM9]
AS
SELECT TOP (100) PERCENT dbo.bom8.item0,
dbo.bom8.item1,
dbo.bom8.item2,
dbo.bom8.item3,
dbo.bom8.item4,
dbo.bom8.item5,
dbo.bom8.item6,
dbo.bom8.item7,
dbo.bom8.item8,
dbo.bm010115.cpn_i           AS ITEM9,
dbo.bm010115.cpn_i           AS ITEM10,
dbo.bm010115.bomcat_i,
dbo.bm010115.bomname_i,
9                            AS [LEVEL],
dbo.bm010115.effectiveindate_i,
dbo.bm010115.bomtype_i,
dbo.iv00101.stndcost,
dbo.bm010115.backflushitem_i,
dbo.bm010115.locncode,
dbo.bm010115.position_number,
dbo.iv00101.itemdesc,
dbo.bm010115.quantity_i,
dbo.bm010115.uofm,
dbo.bom8.zero,
dbo.bom8.one,
dbo.bom8.two,
dbo.bom8.three,
dbo.bom8.four,
dbo.bom8.five,
dbo.bom8.six,
dbo.bom8.seven,
dbo.bom8.eight,
dbo.bm010115.position_number AS nine,
dbo.bom8.q0,
dbo.bom8.q1,
dbo.bom8.q2,
dbo.bom8.q3,
dbo.bom8.q4,
dbo.bom8.q5,
dbo.bom8.q6,
dbo.bom8.q7,
dbo.bom8.q8,
dbo.bm010115.quantity_i      AS Q9
FROM   dbo.bom8
INNER JOIN dbo.bm010115
ON dbo.bom8.bomname_i = dbo.bm010115.bomname_i
AND dbo.bom8.bomcat_i = dbo.bm010115.bomcat_i
AND dbo.bom8.item8 = dbo.bm010115.ppn_i
INNER JOIN dbo.iv00101
ON dbo.bm010115.cpn_i = dbo.iv00101.itemnmbr
ORDER  BY dbo.bm010115.position_number