SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [load].[Aftersales_Rechnungen_ben_AW_final] AS
SELECT convert(varchar(10), [Hauptbetrieb_ID])               AS [Hauptbetrieb_ID]
     , convert(varchar(50), [Hauptbetrieb_Name])             AS [Hauptbetrieb_Name]
     , convert(varchar(10), [Standort_ID])                   AS [Standort_ID]
     , convert(varchar(50), [Standort_Name])                 AS [Standort_Name]
     , convert(varchar(20), [Employee_Function])             AS [Employee_Function]
     , convert(varchar(200), [Serviceberater])               AS [Serviceberater]
	 , convert(varchar(150), [Monteur])                      AS [Monteur]
     , convert(varchar(500), [Order_Number])                 AS [Order Number]
     , convert(varchar(500), [Invoice_Desc_100])             AS [Invoice_Desc_100]
     , convert(varchar(100), [Fabrikat])                     AS [Fabrikat]
     , convert(varchar(20), [Model])                         AS [Model]
     , convert(varchar(100), [Fahrzeug])                     AS [Fahrzeug]
     , convert(varchar(50), [Kostenstelle])                  AS [Kostenstelle]
     , convert(varchar(50), [Marke])                         AS [Marke]
     , convert(varchar(20), [Umsatzart])                     AS [Umsatzart]
     , convert(varchar(20), [Auftragsart])                   AS [Auftragsart]
     , convert(varchar(500), [Auftragsposition])             AS [Auftragsposition]
     , convert(varchar(100), [Kundenart])                    AS [Kundenart]
     , convert(varchar(250), [Kunde])                        AS [Kunde]
     , convert(varchar(500), [Order_Desc_30])                AS [Order_Desc_30]
     , convert(varchar(100), [Invoice_Desc_30])              AS [Invoice_Desc_30]
     , convert(varchar(50), [Zuordnung_Produktbuchungsgruppe]) AS [Zuordnung_Produktbuchungsgruppe]
     , convert(varchar(100), [Produktbuchungsgruppe])        AS [Produktbuchungsgruppe]
     , convert(varchar(50), [FZG_Altersstaffel])             AS [FZG-Altersstaffel]
     , convert(varchar(100), [Repair_Group_Desc])            AS [Repair_Group_Desc]
     , convert(varchar(20), [DB1____EK])                     AS [DB1_><_EK]
     , convert(varchar(20), [Rechnung_Gutschrift])           AS [Rechnung_Gutschrift]
     , convert(varchar(50), [Parts_Focus_Group])             AS [Parts_Focus_Group]
     , convert(varchar(100), [Parts_Make_Desc])              AS [Parts_Make_Desc]
     , convert(varchar(100), [Parts_Group_Desc])             AS [Parts_Group_Desc]
     , convert(varchar(20), [PLZ_1_Stelle])                  AS [PLZ_1_Stelle]
     , convert(varchar(20), [PLZ_2_Stelle])                  AS [PLZ_2_Stelle]
     , convert(varchar(20), [PLZ_3_Stelle])                  AS [PLZ_3_Stelle]
     , convert(varchar(20), [PLZ_4_Stelle])                  AS [PLZ_4_Stelle]
     , convert(varchar(20), [PLZ])                           AS [PLZ]
     , convert(varchar(20), [Zuordnung_Funktion])            AS [Zuordnung_Funktion]
     , convert(varchar(500), [Order_Desc_100])               AS [Order_Desc_100]
     , convert(decimal(28, 8), [Lohn])                       AS [Lohn]
     , convert(decimal(28, 8), [Teile])                      AS [Teile]
     , convert(decimal(28, 8), [EW_Teile])                   AS [EW Teile]
     , convert(decimal(28, 8), [Sonst_])                     AS [Sonst.]
     , convert(decimal(28, 8), [TÜV])                        AS [TÜV]
     , convert(decimal(28, 8), [Fremdl_])                    AS [Fremdl.]
     , convert(decimal(28, 8), [Mietw_])                     AS [Mietw.]
     , convert(decimal(28, 8), [Rädereinl_])                 AS [Rädereinl.]
     , convert(decimal(28, 8), [verk__Std_])                 AS [verk. Std.]
     , convert(decimal(28, 8), [ben__Std_])                  AS [ben. Std.]
     , convert(decimal(28, 8), [NL_Lohn])                    AS [NL Lohn]
     , convert(decimal(28, 8), [NL_Teile])                   AS [NL Teile]
     , convert(decimal(28, 8), [NL_Sonst_])                  AS [NL Sonst.]
     , convert(decimal(28, 8), [DG])                         AS [DG]
     , convert(decimal(28, 8), [NL_Sonst__])                 AS [NL Sonst %]
     , convert(decimal(28, 8), [Anz__AT])                    AS [Anz. AT]
     , convert(decimal(28, 8), [Anwesenheit_Mech_Karo_Lack]) AS [Anwesenheit Mech Karo Lack]
     , convert(decimal(28, 8), [Anwesenheit_Meister])        AS [Anwesenheit Meister]
     , convert(datetime, [Invoice_Date])                     AS [Invoice Date]
     , convert(varchar(500), [Rechnungsausgang])             AS [Rechnungsausgang]
     , convert(int, [Fabrikat_Order_By])                     AS [Fabrikat_Order_By]
     , convert(varchar(150), [Serviceberater_Rg_Steller])    AS [Serviceberater_Rg_Steller]
--INTO [load].[Aftersales_Rechnungen_ben_AW_final]
FROM [transform].[Aftersales_Rechnungen_ben_AW_final]
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
