Dynamics GP BOM Export – Part 8

Dynamics GP BOM Export  – Part 8
USE [COMPANYDB]
go
/****** Object:  View [dbo].[BOM8]    Script Date: 09/04/2013 19:37:00 ******/
SET ansi_nulls ON
go
SET quoted_identifier ON
go
CREATE VIEW [dbo].[BOM8]
AS
SELECT TOP (100) PERCENT dbo.bom7.item0,
dbo.bom7.item1,
dbo.bom7.item2,
dbo.bom7.item3,
dbo.bom7.item4,
dbo.bom7.item5,
dbo.bom7.item6,
dbo.bom7.item7,
dbo.bm010115.cpn_i           AS ITEM8,
dbo.bm010115.cpn_i           AS ITEM9,
dbo.bm010115.cpn_i           AS ITEM10,
dbo.bm010115.bomcat_i,
dbo.bm010115.bomname_i,
8                            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.bom7.zero,
dbo.bom7.one,
dbo.bom7.two,
dbo.bom7.three,
dbo.bom7.four,
dbo.bom7.five,
dbo.bom7.six,
dbo.bom7.seven,
dbo.bm010115.position_number AS eight,
dbo.bom7.nine,
dbo.bom7.q0,
dbo.bom7.q1,
dbo.bom7.q2,
dbo.bom7.q3,
dbo.bom7.q4,
dbo.bom7.q5,
dbo.bom7.q6,
dbo.bom7.q7,
dbo.bm010115.quantity_i      AS Q8,
dbo.bom7.q9
FROM   dbo.bom7
INNER JOIN dbo.bm010115
ON dbo.bom7.bomname_i = dbo.bm010115.bomname_i
AND dbo.bom7.bomcat_i = dbo.bm010115.bomcat_i
AND dbo.bom7.item7 = dbo.bm010115.ppn_i
INNER JOIN dbo.iv00101
ON dbo.bm010115.cpn_i = dbo.iv00101.itemnmbr
ORDER  BY dbo.bm010115.position_number