SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE   VIEW [load].[TBL_SERVICE_GUV_O21] AS

SELECT convert(varchar(50), [Acct Nr])                        AS [Acct Nr]
     , convert(varchar(100), [Ledger Accts Name])             AS [Ledger Accts Name]
     , convert(varchar(100), [Product Group])                 AS [Product Group]
     , convert(varchar(100), [Repair Group])                  AS [Repair Group]
     , convert(varchar(50), [Order Number])                   AS [Order Number]
     , convert(varchar(20), [RG-Typ])                         AS [RG-Typ]
     , convert(varchar(50), [RG-Nummer])                      AS [RG-Nummer]
     , convert(varchar(20), [RG-Typ-Nr])                      AS [RG-Typ-Nr]
     , convert(varchar(10), Rechtseinheit_ID)                 AS Rechtseinheit_ID
     , convert(varchar(50), Rechtseinheit_Name)               AS Rechtseinheit_Name
     , convert(int, Fabrikat_Order_By)                        AS Fabrikat_Order_By
     , convert(varchar(10), Betrieb_ID)                       AS Betrieb_ID
     , convert(varchar(50), Betrieb_Name)                     AS Betrieb_Name
     , convert(varchar(200), Serviceberater)                  AS Serviceberater
     , convert(varchar(10), Umsatzart)                        AS Umsatzart
     , convert(decimal(28, 8), [verk. Stunden])               AS [verk. Stunden]
     , convert(decimal(28, 8), [benutzte Zeit (Auftrag)])     AS [benutzte Zeit (Auftrag)]
     , convert(decimal(28, 8), DG)                            AS DG
     , convert(varchar(50), Zuordnung_Funktion)               AS Zuordnung_Funktion
     , convert(varchar(300), Zuordnung_Produktbuchungsgruppe) AS Zuordnung_Produktbuchungsgruppe
     , convert(varchar(20), Produktbuchungsgruppe)            AS Produktbuchungsgruppe
     , convert(varchar(20), Kostenstelle)                     AS Kostenstelle
     , convert(varchar(20), Auftragsart)                      AS Auftragsart
     , convert(varchar(250), Kunde)                           AS Kunde
     , convert(varchar(20), Kundenart)                        AS Kundenart
     , convert(varchar(500), Order_Desc_100)                  AS Order_Desc_100
     , convert(varchar(50), Auftragsposition)                 AS Auftragsposition
     , convert(varchar(20), Repair_Group_Desc)                AS Repair_Group_Desc
     , convert(varchar(20), [Rechnung/Gutschrift])            AS [Rechnung/Gutschrift]
     , convert(varchar(20), [FZG-Altersstaffel])              AS [FZG-Altersstaffel]
     , convert(varchar(20), [VK < EK])                        AS [VK < EK]
     , 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(100), PLZ)                             AS PLZ
     , convert(datetime, [Invoice Date])                      AS [Invoice Date]
     , convert(decimal(28, 8), Lohn)                          AS Lohn
     , convert(decimal(28, 8), [NL Lohn])                     AS [NL Lohn]
     , convert(decimal(28, 8), [Fremdl.])                     AS [Fremdl.]
     , convert(decimal(28, 8), [EW Fremdl.])                  AS [EW Fremdl.]
     , convert(decimal(28, 8), Teile_gesamt)                  AS Teile_gesamt
     , convert(decimal(28, 8), [EW Teile_gesamt])             AS [EW Teile_gesamt]
     , convert(decimal(28, 8), [NL Teile])                    AS [NL Teile]
     , convert(decimal(28, 8), [Mietw.])                      AS [Mietw.]
     , convert(decimal(28, 8), [Sonst.])                      AS [Sonst.]
     , convert(decimal(28, 8), [EW Sonst.])                   AS [EW Sonst.]
     , convert(decimal(28, 8), [EW Mietw.])                   AS [EW Mietw.]
     , convert(decimal(28, 8), [NL %])                        AS [NL %]
     , convert(decimal(28, 8), [Kulanz %])                    AS [Kulanz %]
     , convert(decimal(28, 8), [NL Lohn %])                   AS [NL Lohn %]
     , convert(decimal(28, 8), [NL Teile %])                  AS [NL Teile %]
     , convert(decimal(28, 8), [Kul. Lohn %])                 AS [Kul. Lohn %]
	 , convert(decimal(28, 8), [Kul. Teile %])                AS [Kul. Teile %]
     , convert(decimal(28, 8), [verk. Std. Monteur])          AS [verk. Std. Monteur]
     , convert(varchar(10), [Gruppe Id])                      AS [Gruppe Id]
     , convert(varchar(10), Woche)                            AS Woche
     , convert(varchar(50), [Gruppe Name])                    AS [Gruppe Name]
     , convert(varchar(50), [Fabrikat operativ])              AS [Fabrikat operativ]
     , convert(varchar(100), Fabrikat_GC_Marken_Order_Line)   AS Fabrikat_GC_Marken_Order_Line
	 , convert(varchar(50), [Model])						  AS [Model]
     , convert(varchar(50), Position)                         AS Position
     , convert(varchar(250), Kunde_RG)                        AS Kunde_RG
     , convert(varchar(100), [Source Table])                  AS [Source Table]
     , convert(varchar(20), [Positionsart])                   AS [Positionsart]
     , convert(date, Datum)                               AS Datum
     , convert(varchar(10), [Jahr/Monat])                     AS [Jahr/Monat]
     , convert(varchar(10), [Aktueller Tag])                  AS [Aktueller Tag]
     , convert(varchar(10), Monatserster)                     AS Monatserster
     , convert(varchar(10), Monatsletzter)                    AS Monatsletzter
     , convert(varchar(10), MUN_DATE)                         AS MUN_DATE
     , convert(varchar(10), Mitgliedsname)                    AS Mitgliedsname
     , convert(datetime, [Beginn Geschäftsjahr])              AS [Beginn Geschäftsjahr]
     , convert(varchar(10), Monat_Jahr)                       AS Monat_Jahr
     , convert(varchar(10), [Anz. Rg.])                       AS [Anz. Rg.]
     , convert(varchar(20), [Anz. Rg. / Auftr.])              AS [Anz. Rg. / Auftr.]
FROM transform.TBL_SERVICE_GUV_O21
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
