SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE view load.Belege_SKR_STK AS
select convert(varchar(10), Rechtseinheit_ID)      AS Rechtseinheit_ID,
       convert(varchar(50), Rechtseinheit_Name)    AS Rechtseinheit_Name,
       convert(varchar(10), Betrieb_ID)            AS Betrieb_ID,
       convert(varchar(50), Betrieb_Name)          AS Betrieb_Name,
       convert(varchar(100), Ebene1)               AS Ebene1,
       convert(varchar(100), Ebene2)               AS Ebene2,
       convert(varchar(100), Ebene3)               AS Ebene3,
       convert(varchar(100), Ebene4)               AS Ebene4,
       convert(varchar(100), Ebene5)               AS Ebene5,
       convert(varchar(100), Ebene6)               AS Ebene6,
       convert(varchar(150), Konto_ori)            AS Konto_ori,
       convert(varchar(10), Acct_Nr)               AS [Acct Nr],
       convert(varchar(500), Text)                 AS Text,
       convert(varchar(20), Kostenstelle)          AS Kostenstelle,
       convert(varchar(200), KST_mit_Bez)          AS KST_mit_Bez,
       convert(varchar(10), KST)                   AS KST,
       convert(varchar(20), Markencode)            AS Markencode,
       convert(varchar(100), Fahrgestellnummer)    AS Fahrgestellnummer,
       convert(varchar(150), Konto_Buchung)        AS Konto_Buchung,
       convert(varchar(200), Marke_mit_Bez)        AS Marke_mit_Bez,
       convert(varchar(50), Marke)                 AS Marke,
       convert(varchar(100), Ebene21)              AS Ebene21,
       convert(varchar(200), Absatzkanal_mit_Bez)  AS Absatzkanal_mit_Bez,
       convert(varchar(20), Absatzkanal)           AS Absatzkanal,
       convert(varchar(50), Ebene31)               AS Ebene31,
       convert(varchar(250), Kostenträger_mit_Bez) AS Kostenträger_mit_Bez,
       convert(int, Kostenträger_FIBU)             AS Kostenträger_FIBU,
       convert(varchar(255), Ebene71)              AS Ebene71,
       convert(varchar(255), Ebene72)              AS Ebene72,
       convert(varchar(255), Ebene73)              AS Ebene73,
       convert(varchar(255), Ebene74)              AS Ebene74,
       convert(varchar(255), Ebene75)              AS Ebene75,
       convert(varchar(255), Ebene76)              AS Ebene76,
       convert(varchar(255), Ebene77)              AS Ebene77,
       convert(varchar(255), Ebene81)              AS Ebene81,
       convert(varchar(255), Ebene82)              AS Ebene82,
       convert(varchar(255), Ebene83)              AS Ebene83,
       convert(varchar(255), Ebene84)              AS Ebene84,
       convert(varchar(255), Ebene85)              AS Ebene85,
       convert(varchar(255), Ebene86)              AS Ebene86,
       convert(varchar(255), GuV_Bilanz_ori)       AS GuV_Bilanz_ori,
       convert(varchar(255), Susa)                 AS Susa,
       convert(varchar(255), Mandant)              AS Mandant,
       convert(decimal(28, 8), Ist)                AS Ist,
       convert(decimal(28, 8), Menge)              AS Menge,
       convert(varchar(10), Gruppe_ID)             AS Gruppe_ID,
       convert(varchar(50), Gruppe_Name)           AS Gruppe_Name,
       convert(datetime, Invoice_Date)             AS [Invoice Date],
       convert(varchar(100), Fabrikat)             AS Fabrikat,
       convert(int, Fabrikat_Order_By)             AS Fabrikat_Order_By,
       convert(varchar(150), Konto)                AS Konto,
       convert(varchar(200), GuV_Bilanz)           AS GuV_Bilanz,
       convert(int, Tag_Dashboard)                 AS Tag_Dashboard,
       convert(int, Monat_Dashboard)               AS Monat_Dashboard,
       convert(int, Jahr_Dashboard)                AS Jahr_Dashboard
from transform.Belege_SKR_STK
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
