SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE view load.Belege_SKR 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(300), Konto)                as Konto,
       convert(varchar(150), Acct_Nr)              as [Acct Nr],
       convert(varchar(500), Text)                 as Text,
       convert(varchar(20), Kostenstelle)          as Kostenstelle,
       convert(varchar(250), KST_mit_Bez)          as KST_mit_Bez,
       convert(varchar(20), KST)                   as KST,
       convert(varchar(20), Markencode)            as Markencode,
       convert(varchar(100), Fahrgestellnummer)    as Fahrgestellnummer,
       convert(varchar(350), Konto_Buchung)        as Konto_Buchung,
       convert(varchar(200), Marke_mit_Bez)        as Marke_mit_Bez,
       convert(varchar(100), Marke)                as Marke,
       convert(varchar(100), Ebene21)              as Ebene21,
       convert(varchar(200), Absatzkanal_mit_Bez)  as Absatzkanal_mit_Bez,
       convert(varchar(100), Absatzkanal)          as Absatzkanal,
       convert(varchar(100), Ebene31)              as Ebene31,
       convert(varchar(206), 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(150), 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(int, Tag_Dashboard)                 as Tag_Dashboard,
       convert(int, Monat_Dashboard)               as Monat_Dashboard,
       convert(int, Jahr_Dashboard)                as Jahr_Dashboard
from transform.Belege_SKR
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
