USE [DD_ECM]
GO

/****** Object:  View [dbo].[VWCUST_NAVISION_IMPERSONAL_ACCOUNT]    Script Date: 21.03.2024 16:59:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



-- TSQL View um Sachkonten aus NAV abzurufen

-- 14.07.2023 - MS - Update BC ID
-- 23.09.2021 - initial

CREATE view [dbo].[VWCUST_NAVISION_IMPERSONAL_ACCOUNT] 
as

	SELECT TOP 1000000
		   'SB-Abwasserbetrieb' as 'Mandant' 
		  ,[No_] as 'Sachkonto'
		  ,[Name] as 'Bezeichnung'
	  FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Abwasserbetrieb d_ Stadt Bebra$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]

	UNION -------------------------------------------------------------------

	SELECT TOP 1000000
		   'SB-Bäderbetrieb' as 'Mandant' 
		  ,[No_] as 'Sachkonto'
		  ,[Name] as 'Bezeichnung'
	  FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Bäderbetrieb der Stadt Bebra$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]

	UNION -------------------------------------------------------------------

	SELECT TOP 1000000
		   'SWB-Netz' as 'Mandant' 
		  ,[No_] as 'Sachkonto'
		  ,[Name] as 'Bezeichnung'
	  FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[STW Bebra GmbH inkl Netz$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]

	UNION -------------------------------------------------------------------

	SELECT TOP 1000000
		   'SWB-Vertrieb' as 'Mandant' 
		  ,[No_] as 'Sachkonto'
		  ,[Name] as 'Bezeichnung'
	  FROM [NTSERP\NTSSUITE].[NTSsuite2015].[dbo].[Vertrieb STW Bebra$G_L Account$437dbf0e-84ff-417a-965d-ed2bb9650972]

ORDER BY Mandant, Sachkonto ASC
GO


