SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE view load.LOC_BELEGE_DETAIL 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(255), Ebene1)               AS Ebene1,
       convert(varchar(255), Ebene2)               AS Ebene2,
       convert(varchar(255), Ebene3)               AS Ebene3,
       convert(varchar(255), Ebene4)               AS Ebene4,
       convert(varchar(255), Ebene5)               AS Ebene5,
       convert(varchar(255), Ebene6)               AS Ebene6,
       convert(varchar(262), Konto)                AS Konto,
       convert(varchar(101), Acct_Nr)              AS Acct_Nr,
       convert(varchar(350), Text)                 AS Text,
       convert(varchar(255), Beleg)                AS Beleg,
       convert(varchar(20), Kostenstelle)          AS Kostenstelle,
       convert(varchar(200), KST_mit_Bez)          AS KST_mit_Bez,
       convert(varchar(20), KST)                   AS KST,
       convert(varchar(50), Markencode)            AS Markencode,
       convert(varchar(100), Fahrgestellnummer)    AS Fahrgestellnummer,
       convert(varchar(300), Konto_Buchung)        AS Konto_Buchung,
       convert(varchar(250), Marke_mit_Bez)        AS Marke_mit_Bez,
       convert(varchar(50), Marke)                 AS Marke,
       convert(nvarchar(50), 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)           AS GuV_Bilanz,
       convert(varchar(255), Susa)                 AS Susa,
       convert(varchar(50), 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(date, Datum)                        AS Datum,
       convert(varchar(20), [Jahr/Monat])          AS [Jahr/Monat],
       convert(date, [Aktueller Tag])              AS [Aktueller Tag],
       convert(date, Monatserster)                 AS Monatserster,
       convert(date, Monatsletzter)                AS Monatsletzter,
       convert(varchar(100), MUN_DATE)             AS MUN_DATE,
       convert(varchar(50), Mitgliedsname)         AS Mitgliedsname,
       convert(date, [Beginn Geschäftsjahr])       AS [Beginn Geschäftsjahr],
       convert(varchar(20), Monat_Jahr)            AS Monat_Jahr,
       convert(varchar(20), Jahr)                  AS Jahr,
       convert(varchar(20), Monat)                 AS Monat,
       convert(nvarchar(4000), Monat_kurz)         AS Monat_kurz
from transform.LOC_BELEGE_DETAIL
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
