Dynamics GP BOM Export – Part 7

Dynamics GP BOM Export  – Part 7

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