batch.Update_AH_Hauptbetrieb.sql 763 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. SET QUOTED_IDENTIFIER ON
  2. GO
  3. SET ANSI_NULLS ON
  4. GO
  5. CREATE PROCEDURE [batch].[Update_AH_Hauptbetrieb]
  6. AS
  7. BEGIN
  8. MERGE INTO [GC_CONFIG].[ari].[AH_Hauptbetrieb]
  9. AS
  10. [dest]
  11. USING
  12. [GC_ETL_ARI].[transform_config].[AH_Hauptbetrieb]
  13. AS
  14. [source]
  15. ON
  16. [dest].[Hauptbetrieb_ID] = [source].[Hauptbetrieb_ID]
  17. WHEN
  18. MATCHED
  19. THEN
  20. UPDATE
  21. SET [dest].[Hauptbetrieb_ID] = [source].[Hauptbetrieb_ID]
  22. WHEN
  23. NOT
  24. MATCHED
  25. THEN
  26. INSERT
  27. ( [Hauptbetrieb_ID]
  28. , [Hauptbetrieb_Name])
  29. VALUES ( [source].[Hauptbetrieb_ID]
  30. , [source].[Hauptbetrieb_Name]);
  31. END
  32. GO
  33. SET QUOTED_IDENTIFIER OFF
  34. GO
  35. SET ANSI_NULLS OFF
  36. GO
  37. GO