SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
CREATE VIEW [test_systemvergleich].[NW_GW_VK_V03] AS
SELECT T1.Periode
     , T1.Verkäufer
     , T1.Menge       AS Menge_Kunde
     , T1.Erlös_FZG   AS Erlös_FZG_Kunde
     , T1.Einsatz_FZG AS Einsatz_FZG_Kunde
     , T1.Erlös_Prov_ AS Erlös_Prov__Kunde
     , T1.Standtage   AS Standtage_Kunde
     , T2.Menge       AS Menge_ETL
     , T2.Erlös_FZG   AS Erlös_FZG_ETL
     , T2.Einsatz_FZG AS Einsatz_FZG_ETL
     , T2.Erlös_Prov_ AS Erlös_Prov__ETL
     , T2.Standtage   AS Standtage_ETL
FROM GC.test.NW_GW_VK_V03 T1
         FULL OUTER JOIN test.NW_GW_VK_V03 T2 ON
    T1.Periode = T2.Periode AND
    T1.Verkäufer = T2.Verkäufer
WHERE T1.[Menge] is null
   OR T2.[Menge] is null
   OR round([T1].[Menge] - [T2].[Menge], 2) <> 0.00
   OR round([T1].[Erlös_FZG] - [T2].[Erlös_FZG], 2) <> 0.00
   OR round([T1].[Einsatz_FZG] - [T2].[Einsatz_FZG], 2) <> 0.00
   OR round([T1].[Erlös_Prov_] - [T2].[Erlös_Prov_], 2) <> 0.00
   OR round([T1].[Standtage] - [T2].[Standtage], 2) <> 0.00
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GO

GO
