Browse Source

scripts für db_create

Global Cube 2 years ago
parent
commit
3d313b0e8e

+ 1 - 10
Tasks/LOCOSOFT_import.bat

@@ -1,12 +1,3 @@
 @call "%~dp0"scripts\config.bat 0 > nul
 
-set PGSRV="C:\Program Files\pgAdmin 4\v4\runtime"
-set PGPASSWORD=loco
-set PGHOST="10.51.104.61"
-
-call sqlexec.bat LOCOSOFT_import_Truncate.sql
-call dtexec.bat LOCOSOFT_import.dtsx Loeffler
-rem call dtexec.bat IMPORT_DATEV.dtsx
-
-%PGSRV%\psql.exe --host=%PGHOST:~1,-1% --username=loco_auswertung_benutzer --dbname=loco_auswertung_db --file %SYSTEM_DIR%\SQL\exec\LOCOSOFT_export_ja.sql
-call dtexec.bat LOCOSOFT_journal_accountings.dtsx
+call db_run.bat LOCOSOFT

BIN
Tasks/scripts/cet.exe


+ 36 - 0
Tasks/scripts/cet.py

@@ -0,0 +1,36 @@
+import plac
+import pyodbc
+
+
+@plac.pos('query', 'SQL Query', type=str)
+@plac.pos('mode', '', choices=['in', 'out', 'queryout'])
+@plac.pos('csv_file', '', type=str)
+@plac.opt('Server', 'Hostname or DSN', type=str)
+@plac.opt('database', '', type=str)
+@plac.opt('user', '', type=str)
+@plac.opt('Password', '', type=str)
+@plac.flg('charset', '')
+@plac.opt('Codepage', '', type=str)
+@plac.opt('errorlog', '', type=str)
+def run(query, mode, csv_file, Server='localhost\\GLOBALCUBE', database='master', user='sa', Password='Mffu3011#', charset=False, Codepage='cp65001', errorlog='error.log'):
+    dsn = f"dsn={Server};uid={user};pwd={Password}"
+    if mode == 'queryout':
+        queryout(dsn, query, csv_file, Codepage, errorlog)
+        return
+    print('This is madness')
+
+
+def queryout(dsn, query, csv_file, codepage, errorlog):
+    try:
+        conn = pyodbc.connect(dsn)
+        cursor = conn.cursor()
+        cursor.execute(query)
+        with open(csv_file, 'w', encoding=codepage, newline='\r\n') as fwh:
+            while row := cursor.fetchone():
+                fwh.write('\t'.join(map(str, row)))
+    except pyodbc.InterfaceError as e:
+        print(e.args[1])
+
+
+if __name__ == '__main__':
+    plac.call(run)

+ 3 - 0
Tasks/scripts/db_create.bat

@@ -0,0 +1,3 @@
+@call "%~dp0config.bat" 0 > nul
+
+..\python\python.exe db_create.py %PORTAL%\System\%SYSTEM:~1,-1%\SQL\config\%~n1.json

+ 183 - 0
Tasks/scripts/db_create.py

@@ -0,0 +1,183 @@
+import json
+from collections import namedtuple
+from pathlib import Path
+
+import pandas as pd
+import plac
+import pyodbc
+
+DbCreateConfig = namedtuple('DbCreateConfig', 'name csv_file clients filter source_dsn target_dsn stage_dir batch_dir')
+DsnConfig = namedtuple('DsnConfig', 'user password server database driver schema')
+
+cfg = DbCreateConfig(**{
+    'name': 'CARLO',
+    'csv_file': 'CARLO.csv',
+    'clients': {'1': 'M und S Fahrzeughandel GmbH'},
+    'filter': ['01.01.2018', '01.01.2019'],
+    'source_dsn': {'user': 'sa', 'password': 'Mffu3011#', 'server': 'GC-SERVER1\\GLOBALCUBE', 'database': 'DE0017', 'driver': 'mssql', 'schema': 'dbo'},
+    'target_dsn': {'user': 'sa', 'password': 'Mffu3011#', 'server': 'GC-SERVER1\\GLOBALCUBE', 'database': 'CARLO2', 'driver': 'mssql', 'schema': 'import'},
+    'stage_dir': '..\\temp',
+    'batch_dir': '..\\batch'
+})
+
+
+class database_inspect():
+    tables = []
+
+    def __init__(self, dsn):
+        self.dsn = DsnConfig(**dsn)
+        self.cursor = self.connect()
+
+    def conn_string(self):
+        if self.dsn.driver == 'mssql':
+            return 'Driver={SQL Server Native Client 11.0};' + f"Server={self.dsn.server};Database={self.dsn.database};Uid={self.dsn.user};Pwd={self.dsn.password}"
+        if self.dsn.driver == 'mysql':
+            return f"mysql+pymysql://{self.dsn.user}:{self.dsn.password}@{self.dsn.server}/{self.dsn.database}?charset=utf8mb4"
+        return f"DSN={self.dsn.server};UID={self.dsn.user};PWD={self.dsn.password}"
+
+    def bcp_conn_params(self):
+        return f"-S {self.dsn.server} -d {self.dsn.database} -U {self.dsn.user} -P {self.dsn.password}"
+
+    def connect(self):
+        c = pyodbc.connect(self.conn_string())
+        return c.cursor()
+
+    def get_tables(self):
+        tables = [x[2] for x in self.cursor.tables(tableType='TABLE')]
+        views = [x[2] for x in self.cursor.tables(tableType='VIEW')]
+        self.tables = tables + views
+        return self.tables
+
+    def get_prefix(self):
+        if (len(self.tables)) == 0:
+            self.get_tables()
+        source_tables_prefix = dict(enumerate(sorted(list(set([t.split('$')[0] for t in self.tables if '$' in t]))), 1))
+        if len(source_tables_prefix) < 0:
+            q = self.cursor.execute('select name FROM sys.databases')
+            source_tables_prefix = [x[0] for x in q.fetchall()]
+        return source_tables_prefix
+
+    def get_columns(self, table):
+        source_insp_cols = [col.column_name for col in self.cursor.columns(table=table)]
+        if len(source_insp_cols) == 0:
+            q = self.cursor.execute(f"SELECT COLUMN_NAME as column_name FROM information_schema.columns WHERE TABLE_NAME = '{self.convert_table(table)}'")
+            source_insp_cols = [col[0] for col in q.fetchall()]
+        return source_insp_cols
+
+    def convert_table(self, table):
+        if '.' in table:
+            table = table.split('.')[-1]
+        if '[' in table:
+            table = table[1:-1]
+        return table
+
+
+@plac.pos('config_file', '', type=str)
+def create(config_file='dbtools/OPTIMA.json'):
+    cfg_import = json.load(open(config_file, 'r', encoding='ansi'))
+    base_dir = Path(config_file).resolve().parent
+    cfg_import['name'] = Path(config_file).stem
+    if cfg_import['stage_dir'][:2] == '..':
+        cfg_import['stage_dir'] = str(base_dir.joinpath(cfg_import['stage_dir']).resolve())
+    if cfg_import['batch_dir'][:2] == '..':
+        cfg_import['batch_dir'] = str(base_dir.joinpath(cfg_import['batch_dir']).resolve())
+    cfg = DbCreateConfig(**cfg_import)
+
+    df = pd.read_csv(f"{base_dir}/{cfg.csv_file}", sep=';', encoding='ansi')
+    config = df[df['target'].notnull()]
+    print(config.head())
+
+    source_db = database_inspect(cfg.source_dsn)
+    source_tables = source_db.get_tables()
+    print(source_db.get_prefix())
+
+    target_db = database_inspect(cfg.target_dsn)
+    target_tables = target_db.get_tables()
+
+    for index, current_table in config.iterrows():
+        with open(f"{cfg.batch_dir}/{current_table['target']}.bat", 'w', encoding='cp850') as f:
+            f.write('@echo off \n')
+            f.write('rem ==' + current_table['target'] + '==\n')
+
+            if not current_table['target'] in target_tables:
+                f.write(f"echo Ziel-Tabelle '{current_table['target']}' existiert nicht!\n")
+                print(f"Ziel-Tabelle '{current_table['target']}' existiert nicht!")
+                continue
+
+            f.write(f"del {cfg.stage_dir}\\{current_table['target']}*.* /Q /F >nul 2>nul \n")
+            f.write(f"sqlcmd.exe {target_db.bcp_conn_params()} -p -Q \"TRUNCATE TABLE [{cfg.target_dsn['schema']}].[{current_table['target']}]\" \n")
+
+            target_columns_list = target_db.get_columns(current_table['target'])
+            if 'client_db' in target_columns_list:
+                target_columns_list.remove('client_db')
+                target_columns_list.append('client_db')
+            target_columns = set(target_columns_list)
+
+            for client_db, prefix in cfg.clients.items():
+                source_table = current_table['source'].format(prefix)
+                if source_table not in source_tables:
+                    source_table2 = source_db.convert_table(source_table)
+                    if source_table2 not in source_tables:
+                        f.write(f"echo Quell-Tabelle '{source_table}' existiert nicht!\n")
+                        print(f"Quell-Tabelle '{source_table}' existiert nicht!")
+                        continue
+
+                source_columns = set(source_db.get_columns(source_table))
+
+                intersect = source_columns.intersection(target_columns)
+                # print("Auf beiden Seiten: " + ";".join(intersect))
+                diff1 = source_columns.difference(target_columns)
+                if len(diff1) > 0:
+                    f.write("rem Nur in Quelle: " + ";".join(diff1) + "\n")
+                diff2 = target_columns.difference(source_columns)
+                if 'client_db' not in diff2:
+                    f.write("echo Spalte 'client_db' fehlt!\n")
+                    print(f"Ziel-Tabelle '{current_table['target']}' Spalte 'client_db' fehlt!")
+                    continue
+                diff2.remove('client_db')
+                if len(diff2) > 0:
+                    f.write("rem Nur in Ziel:   " + ";".join(diff2) + "\n")
+
+                if not pd.isnull(current_table['query']):
+                    select_query = current_table['query'].format(prefix, cfg.filter[0], cfg.filter[1])
+                elif '.' in source_table or cfg.source_dsn['schema'] == '':
+                    select_query = f"SELECT T1.* FROM \\\"{source_table}\\\" T1 "
+                else:
+                    select_query = f"SELECT T1.* FROM {cfg.source_dsn['schema']}.{source_table} T1 "
+
+                if not pd.isnull(current_table['filter']):
+                    select_query += " WHERE " + current_table['filter'].format("", cfg.filter[0], cfg.filter[1])
+                # select_columns = "T1.[" + "], T1.[".join(intersect) + "],"
+                select_columns = ''
+                for col in target_columns_list:
+                    if col in intersect:
+                        select_columns += f"T1.\\\"{col}\\\", "
+                    elif col == 'client_db':
+                        select_columns += "'" + client_db + "' as \\\"client_db\\\", "
+                    else:
+                        select_columns += "'' as \\\"" + col + "\\\", "
+
+                select_query = select_query.replace("T1.*", select_columns[:-2])
+                select_query = select_query.replace("%", "%%")     # batch-Problem
+
+                stage_csv = f"{cfg.stage_dir}\\{current_table['target']}_{client_db}.csv"
+                # insert_query = f"LOAD DATA INFILE '{stage_csv}' INTO TABLE {current_table['target']} FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n';"
+
+                # print(select_query)
+                bulk_copy = 'bcp' if cfg.source_dsn['driver'] == 'mssql' else 'cet'
+                f.write(f"{bulk_copy} \"{select_query}\" queryout \"{stage_csv}\" {source_db.bcp_conn_params()} -c -C 65001 -e \"{stage_csv[:-4]}.queryout.log\" > \"{stage_csv[:-4]}.bcp1.log\" \n")
+                f.write(f"type \"{stage_csv[:-4]}.bcp1.log\" | findstr -v \"1000\" \n")
+                f.write(f"bcp [{cfg.target_dsn['schema']}].[{current_table['target']}] in \"{stage_csv}\" {target_db.bcp_conn_params()} -c -C 65001 -m 1000 -e \"{stage_csv[:-4]}.in.log\" > \"{stage_csv[:-4]}.bcp2.log\" \n")
+                f.write(f"type \"{stage_csv[:-4]}.bcp2.log\" | findstr -v \"1000\" \n")
+
+    with open(f"{cfg.batch_dir}/_{cfg.name}.bat", 'w', encoding='cp850') as f:
+        f.write("@echo off & cd /d %~dp0 \n")
+        f.write(f"del {cfg.stage_dir}\\*.* /Q /F >nul 2>nul \n\n")
+        for index, current_table in config.iterrows():
+            f.write(f"echo =={current_table['target']}==\n")
+            f.write(f"echo {current_table['target']} >CON \n")
+            f.write(f"call {current_table['target']}.bat\n\n")
+
+
+if __name__ == '__main__':
+    plac.call(create)

+ 3 - 0
Tasks/scripts/db_run.bat

@@ -0,0 +1,3 @@
+@call "%~dp0config.bat" 0 > nul
+
+..\python\python.exe db_run.py %1

+ 19 - 0
Tasks/scripts/db_run.py

@@ -0,0 +1,19 @@
+from concurrent.futures import ThreadPoolExecutor
+from pathlib import Path
+import subprocess
+
+
+def task(name):
+    print(Path(name).name)
+    return subprocess.Popen(f'C:\\Windows\\System32\\cmd.exe /C "{name}"', stdout=subprocess.DEVNULL).wait()
+
+
+def main(base_dir):
+    files = [str(f) for f in Path(base_dir).glob('*.bat') if not f.name.startswith('_')]
+
+    with ThreadPoolExecutor(max_workers=5) as executor:
+        executor.map(task, files)
+
+
+if __name__ == '__main__':
+    main('C:\\GlobalCube\\System\\LOCOSOFT\\SQL\\batch')

+ 1275 - 0
Tasks/scripts/pkeys.json

@@ -0,0 +1,1275 @@
+{
+  "absence_calendar": [
+    "   [employee_number] [int] NOT NULL",
+    "   [date] [datetime] NOT NULL",
+    "   [unique_dummy] [int] NOT NULL",
+    "   [type] [varchar](10) NULL",
+    "   [is_payed] [smallint] NULL",
+    "   [day_contingent] [numeric](6,2) NULL",
+    "   [reason] [varchar](10) NULL",
+    "   [booking_flag] [varchar](10) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [absence_calendar$0] PRIMARY KEY CLUSTERED ([employee_number], [date], [unique_dummy], [client_db])"
+  ],
+  "absence_reasons": [
+    "   [id] [varchar](10) NOT NULL",
+    "   [description] [varchar](50) NULL",
+    "   [is_annual_vacation] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [absence_reasons$0] PRIMARY KEY CLUSTERED ([id], [client_db])"
+  ],
+  "absence_types": [
+    "   [type] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [absence_types$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "accounts_characteristics": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [skr51_branch] [bigint] NOT NULL",
+    "   [skr51_make] [bigint] NOT NULL",
+    "   [skr51_cost_center] [bigint] NOT NULL",
+    "   [skr51_sales_channel] [bigint] NOT NULL",
+    "   [skr51_cost_unit] [bigint] NOT NULL",
+    "   [skr51_brach_name] [varchar](100) NULL",
+    "   [skr51_make_description] [varchar](100) NULL",
+    "   [skr51_cost_center_name] [varchar](100) NULL",
+    "   [skr51_sales_channel_name] [varchar](100) NULL",
+    "   [skr51_cost_unit_name] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [accounts_characteristics$0] PRIMARY KEY CLUSTERED ([subsidiary_to_company_ref], [skr51_branch], [skr51_make], [skr51_cost_center], [skr51_sales_channel], [skr51_cost_unit], [client_db])"
+  ],
+  "appointments": [
+    "   [id] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [appointment_type] [int] NULL",
+    "   [customer_number] [int] NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [comment] [varchar](255) NULL",
+    "   [created_by_employee] [int] NULL",
+    "   [created_timestamp] [bigint] NULL",
+    "   [locked_by_employee] [int] NULL",
+    "   [blocked_timestamp] [bigint] NULL",
+    "   [bring_timestamp] [bigint] NULL",
+    "   [return_timestamp] [bigint] NULL",
+    "   [pseudo_customer_name] [varchar](255) NULL",
+    "   [pseudo_customer_country] [varchar](10) NULL",
+    "   [pseudo_customer_zip_code] [varchar](100) NULL",
+    "   [pseudo_customer_home_city] [varchar](100) NULL",
+    "   [pseudo_customer_home_street] [varchar](100) NULL",
+    "   [pseudo_vehicle_make_number] [int] NULL",
+    "   [pseudo_vehicle_make_text] [varchar](50) NULL",
+    "   [pseudo_model_code] [varchar](50) NULL",
+    "   [pseudo_model_text] [varchar](50) NULL",
+    "   [order_number] [int] NULL",
+    "   [is_customer_reminder_allowed] [smallint] NULL",
+    "   [customer_reminder_type] [varchar](100) NULL",
+    "   [customer_reminder_timestamp] [bigint] NULL",
+    "   [bring_duration] [int] NULL",
+    "   [bring_employee_no] [int] NULL",
+    "   [return_duration] [int] NULL",
+    "   [return_employee_no] [int] NULL",
+    "   [customer_pickup_bring] [int] NULL",
+    "   [is_general_inspection_service] [smallint] NULL",
+    "   [urgency] [int] NULL",
+    "   [vehicle_status] [int] NULL",
+    "   [progress_status] [int] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [appointments$0] PRIMARY KEY CLUSTERED ([id], [client_db])"
+  ],
+  "appointments_text": [
+    "   [appointment_id] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [appointments_text$0] PRIMARY KEY CLUSTERED ([appointment_id], [client_db])"
+  ],
+  "charge_type_descriptions": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [charge_type_descriptions$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "charge_types": [
+    "   [type] [int] NOT NULL",
+    "   [subsidiary] [int] NOT NULL",
+    "   [timeunit_rate] [numeric](11,3) NULL",
+    "   [department] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [charge_types$0] PRIMARY KEY CLUSTERED ([type], [subsidiary], [client_db])"
+  ],
+  "clearing_delay_types": [
+    "   [type] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [clearing_delay_types$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "codes_customer_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [format] [varchar](10) NULL",
+    "   [length] [int] NULL",
+    "   [decimal] [int] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_customer_def$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "codes_customer_list": [
+    "   [customer_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [value_format] [varchar](10) NULL",
+    "   [value_text] [varchar](100) NULL",
+    "   [value_numeric] [numeric](20,9) NULL",
+    "   [value_date] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_customer_list$0] PRIMARY KEY CLUSTERED ([customer_number], [code], [client_db])"
+  ],
+  "codes_vehicle_date": [
+    "   [vehicle_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [date] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_vehicle_date$0] PRIMARY KEY CLUSTERED ([vehicle_number], [code], [client_db])"
+  ],
+  "codes_vehicle_date_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [month_increase_factor] [int] NULL",
+    "   [show_in_211_from_or_to] [varchar](10) NULL",
+    "   [is_backdate_on_exceeding] [smallint] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_vehicle_date_def$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "codes_vehicle_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [format] [varchar](10) NULL",
+    "   [length] [int] NULL",
+    "   [decimal] [int] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_vehicle_def$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "codes_vehicle_list": [
+    "   [vehicle_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [value_format] [varchar](10) NULL",
+    "   [value_text] [varchar](100) NULL",
+    "   [value_numeric] [numeric](20,9) NULL",
+    "   [value_date] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_vehicle_list$0] PRIMARY KEY CLUSTERED ([vehicle_number], [code], [client_db])"
+  ],
+  "codes_vehicle_mileage": [
+    "   [vehicle_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [kilometer] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_vehicle_mileage$0] PRIMARY KEY CLUSTERED ([vehicle_number], [code], [client_db])"
+  ],
+  "codes_vehicle_mileage_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [mileage_increase_factor] [int] NULL",
+    "   [show_in_211_from_or_to] [varchar](10) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [codes_vehicle_mileage_def$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "com_number_types": [
+    "   [typ] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [is_office_number] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [com_number_types$0] PRIMARY KEY CLUSTERED ([typ], [client_db])"
+  ],
+  "configuration": [
+    "   [type] [varchar](100) NOT NULL",
+    "   [value_numeric] [bigint] NOT NULL",
+    "   [value_text] [varchar](255) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [configuration$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "configuration_numeric": [
+    "   [parameter_number] [int] NOT NULL",
+    "   [subsidiary] [int] NOT NULL",
+    "   [text_value] [varchar](50) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [configuration_numeric$0] PRIMARY KEY CLUSTERED ([parameter_number], [subsidiary], [client_db])"
+  ],
+  "countries": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [iso3166_alpha2] [varchar](10) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [countries$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "customer_codes": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [customer_codes$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "customer_com_numbers": [
+    "   [customer_number] [int] NOT NULL",
+    "   [counter] [bigint] NOT NULL",
+    "   [com_type] [varchar](10) NULL",
+    "   [is_reference] [smallint] NULL",
+    "   [only_on_1st_tab] [smallint] NULL",
+    "   [address] [varchar](255) NULL",
+    "   [has_contact_person_fields] [smallint] NULL",
+    "   [contact_salutation] [varchar](100) NULL",
+    "   [contact_firstname] [varchar](255) NULL",
+    "   [contact_lastname] [varchar](255) NULL",
+    "   [contact_description] [varchar](255) NULL",
+    "   [note] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [customer_com_numbers$0] PRIMARY KEY CLUSTERED ([customer_number], [counter], [client_db])"
+  ],
+  "customer_profession_codes": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [customer_profession_codes$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "customer_supplier_bank_information": [
+    "   [customer_number] [int] NOT NULL",
+    "   [iban] [varchar](100) NULL",
+    "   [swift] [varchar](50) NULL",
+    "   [sepa_mandate_start_date] [datetime] NULL",
+    "   [note] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [customer_supplier_bank_information$0] PRIMARY KEY CLUSTERED ([customer_number], [client_db])"
+  ],
+  "customer_to_customercodes": [
+    "   [customer_number] [int] NOT NULL",
+    "   [customer_code] [int] NOT NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [customer_to_customercodes$0] PRIMARY KEY CLUSTERED ([customer_number], [customer_code], [client_db])"
+  ],
+  "customer_to_professioncodes": [
+    "   [customer_number] [int] NOT NULL",
+    "   [profession_code] [int] NOT NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [customer_to_professioncodes$0] PRIMARY KEY CLUSTERED ([customer_number], [profession_code], [client_db])"
+  ],
+  "customers_suppliers": [
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [is_supplier] [smallint] NULL",
+    "   [is_natural_person] [smallint] NULL",
+    "   [is_dummy_customer] [smallint] NULL",
+    "   [salutation_code] [varchar](10) NULL",
+    "   [name_prefix] [varchar](100) NULL",
+    "   [first_name] [varchar](100) NULL",
+    "   [family_name] [varchar](100) NULL",
+    "   [name_postfix] [varchar](100) NULL",
+    "   [country_code] [varchar](10) NULL",
+    "   [zip_code] [varchar](100) NULL",
+    "   [home_city] [varchar](100) NULL",
+    "   [home_street] [varchar](100) NULL",
+    "   [contact_salutation_code] [varchar](10) NULL",
+    "   [contact_family_name] [varchar](100) NULL",
+    "   [contact_first_name] [varchar](100) NULL",
+    "   [contact_note] [varchar](100) NULL",
+    "   [contact_personal_known] [smallint] NULL",
+    "   [parts_rebate_group_buy] [int] NULL",
+    "   [parts_rebate_group_sell] [int] NULL",
+    "   [rebate_labour_percent] [numeric](11,5) NULL",
+    "   [rebate_material_percent] [numeric](11,5) NULL",
+    "   [rebate_new_vehicles_percent] [numeric](11,5) NULL",
+    "   [cash_discount_percent] [numeric](11,5) NULL",
+    "   [vat_id_number] [varchar](100) NULL",
+    "   [vat_id_number_checked_date] [datetime] NULL",
+    "   [vat_id_free_code_1] [int] NULL",
+    "   [vat_id_free_code_2] [int] NULL",
+    "   [birthday] [datetime] NULL",
+    "   [last_contact] [datetime] NULL",
+    "   [preferred_com_number_type] [varchar](10) NULL",
+    "   [created_date] [datetime] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [updated_date] [datetime] NULL",
+    "   [updated_employee_no] [int] NULL",
+    "   [name_updated_date] [datetime] NULL",
+    "   [name_updated_employee_no] [int] NULL",
+    "   [sales_assistant_employee_no] [int] NULL",
+    "   [service_assistant_employee_no] [int] NULL",
+    "   [parts_assistant_employee_no] [int] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [customers_suppliers$0] PRIMARY KEY CLUSTERED ([customer_number], [client_db])"
+  ],
+  "dealer_vehicles": [
+    "   [dealer_vehicle_type] [varchar](10) NOT NULL",
+    "   [dealer_vehicle_number] [int] NOT NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [location] [varchar](50) NULL",
+    "   [buyer_customer_no] [int] NULL",
+    "   [deregistration_date] [datetime] NULL",
+    "   [refinancing_start_date] [datetime] NULL",
+    "   [refinancing_end_date] [datetime] NULL",
+    "   [refinancing_value] [numeric](11,2) NULL",
+    "   [refinancing_refundment] [numeric](11,2) NULL",
+    "   [refinancing_bank_customer_no] [int] NULL",
+    "   [refinanc_interest_free_date] [datetime] NULL",
+    "   [in_subsidiary] [int] NULL",
+    "   [in_buy_salesman_number] [int] NULL",
+    "   [in_buy_order_no] [varchar](50) NULL",
+    "   [in_buy_order_no_date] [datetime] NULL",
+    "   [in_buy_invoice_no] [varchar](50) NULL",
+    "   [in_buy_invoice_no_date] [datetime] NULL",
+    "   [in_buy_edp_order_no] [varchar](50) NULL",
+    "   [in_buy_edp_order_no_date] [datetime] NULL",
+    "   [in_is_trade_in_ken] [varchar](10) NULL",
+    "   [in_is_trade_in_kom] [int] NULL",
+    "   [in_used_vehicle_buy_type] [varchar](10) NULL",
+    "   [in_buy_list_price] [numeric](11,2) NULL",
+    "   [in_arrival_date] [datetime] NULL",
+    "   [in_expected_arrival_date] [datetime] NULL",
+    "   [in_accounting_document_type] [varchar](10) NULL",
+    "   [in_accounting_document_number] [bigint] NULL",
+    "   [in_accounting_document_date] [datetime] NULL",
+    "   [in_acntg_exceptional_group] [varchar](50) NULL",
+    "   [in_acntg_cost_unit_new_vehicle] [numeric](4,0) NULL",
+    "   [in_accounting_make] [numeric](4,0) NULL",
+    "   [in_registration_reference] [varchar](50) NULL",
+    "   [in_expected_repair_cost] [numeric](11,2) NULL",
+    "   [in_order_status] [varchar](10) NULL",
+    "   [out_subsidiary] [int] NULL",
+    "   [out_is_ready_for_sale] [smallint] NULL",
+    "   [out_ready_for_sale_date] [datetime] NULL",
+    "   [out_sale_type] [varchar](10) NULL",
+    "   [out_sales_contract_number] [varchar](50) NULL",
+    "   [out_sales_contract_date] [datetime] NULL",
+    "   [out_is_sales_contract_confrmed] [smallint] NULL",
+    "   [out_salesman_number_1] [int] NULL",
+    "   [out_salesman_number_2] [int] NULL",
+    "   [out_desired_shipment_date] [datetime] NULL",
+    "   [out_is_registration_included] [smallint] NULL",
+    "   [out_recommended_retail_price] [numeric](11,2) NULL",
+    "   [out_extra_expenses] [numeric](11,2) NULL",
+    "   [out_sale_price] [numeric](11,2) NULL",
+    "   [out_sale_price_dealer] [numeric](11,2) NULL",
+    "   [out_sale_price_minimum] [numeric](11,2) NULL",
+    "   [out_sale_price_internet] [numeric](11,2) NULL",
+    "   [out_estimated_invoice_value] [numeric](11,2) NULL",
+    "   [out_discount_percent_vehicle] [numeric](11,5) NULL",
+    "   [out_discount_percent_accessory] [numeric](11,5) NULL",
+    "   [out_order_number] [int] NULL",
+    "   [out_invoice_type] [int] NULL",
+    "   [out_invoice_number] [int] NULL",
+    "   [out_invoice_date] [datetime] NULL",
+    "   [out_deposit_invoice_type] [int] NULL",
+    "   [out_deposit_invoice_number] [int] NULL",
+    "   [out_deposit_value] [numeric](11,2) NULL",
+    "   [out_license_plate] [varchar](50) NULL",
+    "   [out_make_number] [int] NULL",
+    "   [out_model_code] [varchar](100) NULL",
+    "   [out_license_plate_country] [varchar](10) NULL",
+    "   [out_license_plate_season] [varchar](50) NULL",
+    "   [calc_basic_charge] [numeric](11,2) NULL",
+    "   [calc_accessory] [numeric](11,2) NULL",
+    "   [calc_extra_expenses] [numeric](11,2) NULL",
+    "   [calc_usage_value_encr_external] [numeric](11,2) NULL",
+    "   [calc_usage_value_encr_internal] [numeric](11,2) NULL",
+    "   [calc_usage_value_encr_other] [numeric](11,2) NULL",
+    "   [calc_total_writedown] [numeric](11,2) NULL",
+    "   [calc_cost_percent_stockingdays] [numeric](5,0) NULL",
+    "   [calc_interest_percent_stkdays] [numeric](8,3) NULL",
+    "   [calc_actual_payed_interest] [numeric](11,2) NULL",
+    "   [calc_commission_for_arranging] [numeric](11,2) NULL",
+    "   [calc_commission_for_salesman] [numeric](11,2) NULL",
+    "   [calc_cost_internal_invoices] [numeric](11,2) NULL",
+    "   [calc_cost_other] [numeric](11,2) NULL",
+    "   [calc_sales_aid] [numeric](11,2) NULL",
+    "   [calc_sales_aid_finish] [numeric](11,2) NULL",
+    "   [calc_sales_aid_bonus] [numeric](11,2) NULL",
+    "   [calc_returns_workshop] [numeric](11,2) NULL",
+    "   [exclusive_reserved_employee_no] [int] NULL",
+    "   [exclusive_reserved_until] [datetime] NULL",
+    "   [pre_owned_car_code] [varchar](10) NULL",
+    "   [is_sale_internet] [smallint] NULL",
+    "   [is_sale_prohibit] [smallint] NULL",
+    "   [is_agency_business] [smallint] NULL",
+    "   [is_rental_or_school_vehicle] [smallint] NULL",
+    "   [previous_owner_number] [int] NULL",
+    "   [mileage_km] [int] NULL",
+    "   [memo] [varchar](255) NULL",
+    "   [keys_box_number] [int] NULL",
+    "   [last_change_date] [datetime] NULL",
+    "   [last_change_employee_no] [int] NULL",
+    "   [created_date] [datetime] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [has_financing_example] [smallint] NULL",
+    "   [has_leasing_example_ref] [smallint] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [dealer_vehicles$0] PRIMARY KEY CLUSTERED ([dealer_vehicle_type], [dealer_vehicle_number], [client_db])"
+  ],
+  "document_types": [
+    "   [document_type_in_journal] [varchar](100) NOT NULL",
+    "   [document_type_description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [document_types$0] PRIMARY KEY CLUSTERED ([document_type_in_journal], [client_db])"
+  ],
+  "employees": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NULL",
+    "   [subsidiary] [int] NULL",
+    "   [has_constant_salary] [smallint] NULL",
+    "   [name] [varchar](100) NULL",
+    "   [initials] [varchar](10) NULL",
+    "   [customer_number] [int] NULL",
+    "   [mechanic_number] [int] NULL",
+    "   [salesman_number] [int] NULL",
+    "   [is_business_executive] [smallint] NULL",
+    "   [is_master_craftsman] [smallint] NULL",
+    "   [employment_date] [datetime] NULL",
+    "   [termination_date] [datetime] NULL",
+    "   [leave_date] [datetime] NULL",
+    "   [is_flextime] [smallint] NULL",
+    "   [break_time_registration] [varchar](50) NULL",
+    "   [productivity_factor] [numeric](4,1) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [employees$0] PRIMARY KEY CLUSTERED ([employee_number], [client_db])"
+  ],
+  "employees_breaktimes": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NOT NULL",
+    "   [dayofweek] [int] NOT NULL",
+    "   [break_start] [numeric](7,3) NOT NULL",
+    "   [break_end] [numeric](7,3) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [employees_breaktimes$0] PRIMARY KEY CLUSTERED ([employee_number], [validity_date], [dayofweek], [break_start], [client_db])"
+  ],
+  "employees_history": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [has_constant_salary] [smallint] NULL",
+    "   [name] [varchar](100) NULL",
+    "   [initials] [varchar](10) NULL",
+    "   [customer_number] [int] NULL",
+    "   [mechanic_number] [int] NULL",
+    "   [salesman_number] [int] NULL",
+    "   [is_business_executive] [smallint] NULL",
+    "   [is_master_craftsman] [smallint] NULL",
+    "   [employment_date] [datetime] NULL",
+    "   [termination_date] [datetime] NULL",
+    "   [leave_date] [datetime] NULL",
+    "   [is_flextime] [smallint] NULL",
+    "   [break_time_registration] [varchar](50) NULL",
+    "   [productivity_factor] [numeric](4,1) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [employees_history$0] PRIMARY KEY CLUSTERED ([employee_number], [validity_date], [client_db])"
+  ],
+  "employees_worktimes": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NOT NULL",
+    "   [dayofweek] [int] NOT NULL",
+    "   [work_duration] [numeric](7,3) NULL",
+    "   [worktime_start] [numeric](7,3) NULL",
+    "   [worktime_end] [numeric](7,3) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [employees_worktimes$0] PRIMARY KEY CLUSTERED ([employee_number], [validity_date], [dayofweek], [client_db])"
+  ],
+  "external_customer_references": [
+    "   [api_type] [varchar](50) NOT NULL",
+    "   [api_id] [varchar](50) NOT NULL",
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary] [int] NOT NULL",
+    "   [reference] [varchar](255) NULL",
+    "   [last_received_time] [bigint] NULL",
+    "   [version] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [external_customer_references$0] PRIMARY KEY CLUSTERED ([api_type], [api_id], [customer_number], [subsidiary], [client_db])"
+  ],
+  "external_reference_parties": [
+    "   [api_type] [varchar](50) NOT NULL",
+    "   [api_id] [varchar](50) NOT NULL",
+    "   [make] [varchar](50) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [external_reference_parties$0] PRIMARY KEY CLUSTERED ([api_type], [api_id], [client_db])"
+  ],
+  "financing_examples": [
+    "   [id] [int] NOT NULL",
+    "   [initial_payment] [numeric](11,2) NULL",
+    "   [loan_amount] [numeric](11,2) NULL",
+    "   [number_rates] [int] NULL",
+    "   [annual_percentage_rate] [numeric](6,2) NULL",
+    "   [debit_interest] [numeric](6,2) NULL",
+    "   [debit_interest_type] [varchar](100) NULL",
+    "   [monthly_rate] [numeric](11,2) NULL",
+    "   [differing_first_rate] [numeric](11,2) NULL",
+    "   [last_rate] [numeric](11,2) NULL",
+    "   [rate_insurance] [numeric](11,2) NULL",
+    "   [acquisition_fee] [numeric](11,2) NULL",
+    "   [total] [numeric](11,2) NULL",
+    "   [interest_free_credit_until] [datetime] NULL",
+    "   [interest_free_credit_amount] [numeric](11,2) NULL",
+    "   [due_date] [int] NULL",
+    "   [due_date_last_rate] [int] NULL",
+    "   [bank_customer_no] [int] NULL",
+    "   [source] [varchar](50) NULL",
+    "   [referenced_dealer_vehicle_type] [varchar](10) NULL",
+    "   [referenced_dealer_vehicle_no] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [financing_examples$0] PRIMARY KEY CLUSTERED ([id], [client_db])"
+  ],
+  "fuels": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [fuels$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "invoice_types": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [invoice_types$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "invoices": [
+    "   [invoice_type] [int] NOT NULL",
+    "   [invoice_number] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [order_number] [int] NULL",
+    "   [paying_customer] [int] NULL",
+    "   [invoice_date] [datetime] NULL",
+    "   [service_date] [datetime] NULL",
+    "   [is_canceled] [smallint] NULL",
+    "   [cancelation_number] [int] NULL",
+    "   [cancelation_date] [datetime] NULL",
+    "   [cancelation_employee] [int] NULL",
+    "   [is_own_vehicle] [smallint] NULL",
+    "   [is_credit] [smallint] NULL",
+    "   [credit_invoice_type] [int] NULL",
+    "   [credit_invoice_number] [int] NULL",
+    "   [odometer_reading] [int] NULL",
+    "   [creating_employee] [int] NULL",
+    "   [internal_cost_account] [int] NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [full_vat_basevalue] [numeric](11,2) NULL",
+    "   [full_vat_percentage] [numeric](6,2) NULL",
+    "   [full_vat_value] [numeric](20,2) NULL",
+    "   [reduced_vat_basevalue] [numeric](11,2) NULL",
+    "   [reduced_vat_percentage] [numeric](6,2) NULL",
+    "   [reduced_vat_value] [numeric](20,2) NULL",
+    "   [used_part_vat_value] [numeric](11,2) NULL",
+    "   [job_amount_net] [numeric](20,2) NULL",
+    "   [job_amount_gross] [numeric](20,2) NULL",
+    "   [job_rebate] [numeric](11,2) NULL",
+    "   [part_amount_net] [numeric](20,2) NULL",
+    "   [part_amount_gross] [numeric](20,2) NULL",
+    "   [part_rebate] [numeric](11,2) NULL",
+    "   [part_disposal] [numeric](11,2) NULL",
+    "   [total_gross] [numeric](20,2) NULL",
+    "   [total_net] [numeric](20,2) NULL",
+    "   [parts_rebate_group_sell] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [invoices$0] PRIMARY KEY CLUSTERED ([invoice_type], [invoice_number], [client_db])"
+  ],
+  "journal_accountings": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [accounting_date] [datetime] NOT NULL",
+    "   [document_type] [varchar](100) NOT NULL",
+    "   [document_number] [bigint] NOT NULL",
+    "   [position_in_document] [bigint] NOT NULL",
+    "   [customer_number] [bigint] NULL",
+    "   [nominal_account_number] [bigint] NULL",
+    "   [is_balanced] [varchar](100) NULL",
+    "   [clearing_number] [bigint] NULL",
+    "   [document_date] [datetime] NULL",
+    "   [posted_value] [bigint] NULL",
+    "   [debit_or_credit] [varchar](100) NULL",
+    "   [posted_count] [bigint] NULL",
+    "   [branch_number] [bigint] NULL",
+    "   [customer_contra_account] [bigint] NULL",
+    "   [nominal_contra_account] [bigint] NULL",
+    "   [contra_account_text] [varchar](100) NULL",
+    "   [account_form_page_number] [bigint] NULL",
+    "   [account_form_page_line] [bigint] NULL",
+    "   [serial_number_each_month] [bigint] NULL",
+    "   [employee_number] [bigint] NULL",
+    "   [invoice_date] [datetime] NULL",
+    "   [invoice_number] [varchar](100) NULL",
+    "   [dunning_level] [varchar](100) NULL",
+    "   [last_dunning_date] [datetime] NULL",
+    "   [journal_page] [bigint] NULL",
+    "   [journal_line] [bigint] NULL",
+    "   [cash_discount] [bigint] NULL",
+    "   [term_of_payment] [bigint] NULL",
+    "   [posting_text] [varchar](100) NULL",
+    "   [vehicle_reference] [varchar](100) NULL",
+    "   [vat_id_number] [varchar](100) NULL",
+    "   [account_statement_number] [bigint] NULL",
+    "   [account_statement_page] [bigint] NULL",
+    "   [vat_key] [varchar](100) NULL",
+    "   [days_for_cash_discount] [bigint] NULL",
+    "   [day_of_actual_accounting] [datetime] NULL",
+    "   [skr51_branch] [bigint] NULL",
+    "   [skr51_make] [bigint] NULL",
+    "   [skr51_cost_center] [bigint] NULL",
+    "   [skr51_sales_channel] [bigint] NULL",
+    "   [skr51_cost_unit] [bigint] NULL",
+    "   [previously_used_account_no] [varchar](100) NULL",
+    "   [free_form_accounting_text] [varchar](100) NULL",
+    "   [free_form_document_text] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [journal_accountings$0] PRIMARY KEY CLUSTERED ([subsidiary_to_company_ref], [accounting_date], [document_type], [document_number], [position_in_document], [client_db])"
+  ],
+  "labour_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [labour_types$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "labours": [
+    "   [order_number] [int] NOT NULL",
+    "   [order_position] [int] NOT NULL",
+    "   [order_position_line] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [is_invoiced] [smallint] NULL",
+    "   [invoice_type] [int] NULL",
+    "   [invoice_number] [int] NULL",
+    "   [employee_no] [int] NULL",
+    "   [mechanic_no] [int] NULL",
+    "   [labour_operation_id] [varchar](100) NULL",
+    "   [is_nominal] [smallint] NULL",
+    "   [time_units] [numeric](11,2) NULL",
+    "   [net_price_in_order] [numeric](11,2) NULL",
+    "   [rebate_percent] [numeric](6,2) NULL",
+    "   [goodwill_percent] [numeric](6,1) NULL",
+    "   [charge_type] [int] NULL",
+    "   [text_line] [varchar](255) NULL",
+    "   [usage_value] [numeric](11,2) NULL",
+    "   [negative_flag] [varchar](10) NULL",
+    "   [labour_type] [varchar](10) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [labours$0] PRIMARY KEY CLUSTERED ([order_number], [order_position], [order_position_line], [client_db])"
+  ],
+  "labours_compressed": [
+    "   [order_number] [int] NOT NULL",
+    "   [order_position] [int] NOT NULL",
+    "   [order_position_line_start] [int] NOT NULL",
+    "   [order_position_line_end] [int] NULL",
+    "   [labour_operation_id] [varchar](100) NULL",
+    "   [time_units] [numeric](11,2) NULL",
+    "   [net_price_in_order] [numeric](11,2) NULL",
+    "   [text] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [labours_compressed$0] PRIMARY KEY CLUSTERED ([order_number], [order_position], [order_position_line_start], [client_db])"
+  ],
+  "labours_groups": [
+    "   [source] [varchar](50) NOT NULL",
+    "   [labour_number_range] [varchar](50) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [labours_groups$0] PRIMARY KEY CLUSTERED ([source], [labour_number_range], [client_db])"
+  ],
+  "labours_master": [
+    "   [source] [varchar](50) NOT NULL",
+    "   [labour_number] [varchar](50) NOT NULL",
+    "   [mapping_code] [varchar](50) NOT NULL",
+    "   [text] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [labours_master$0] PRIMARY KEY CLUSTERED ([source], [labour_number], [mapping_code], [client_db])"
+  ],
+  "leasing_examples": [
+    "   [id] [int] NOT NULL",
+    "   [number_rates] [int] NULL",
+    "   [annual_mileage] [int] NULL",
+    "   [special_payment] [numeric](11,2) NULL",
+    "   [calculation_basis] [numeric](11,2) NULL",
+    "   [calculation_basis_factor] [numeric](6,2) NULL",
+    "   [gross_residual_value] [numeric](11,2) NULL",
+    "   [gross_residual_value_factor] [numeric](6,2) NULL",
+    "   [monthly_rate] [numeric](11,2) NULL",
+    "   [exceeding_mileage] [numeric](11,2) NULL",
+    "   [under_usage_mileage] [numeric](11,2) NULL",
+    "   [bank_customer_no] [int] NULL",
+    "   [source] [varchar](50) NULL",
+    "   [referenced_dealer_vehicle_type] [varchar](10) NULL",
+    "   [referenced_dealer_vehicle_no] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [leasing_examples$0] PRIMARY KEY CLUSTERED ([id], [client_db])"
+  ],
+  "makes": [
+    "   [make_number] [int] NOT NULL",
+    "   [is_actual_make] [smallint] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [group_name] [varchar](50) NULL",
+    "   [make_id_in_group] [varchar](50) NULL",
+    "   [internal_labour_group] [int] NULL",
+    "   [is_production_year_visible] [smallint] NULL",
+    "   [is_transmission_no_visible] [smallint] NULL",
+    "   [is_engine_no_visible] [smallint] NULL",
+    "   [is_ricambi_no_visible] [smallint] NULL",
+    "   [ricambi_label] [varchar](100) NULL",
+    "   [is_preset_finance_stock_rate] [smallint] NULL",
+    "   [rate_free_days_new_vehicle] [int] NULL",
+    "   [rate_free_days_demo_vehicle] [int] NULL",
+    "   [special_service_2_interval] [numeric](6,1) NULL",
+    "   [special_service_3_interval] [numeric](6,1) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [makes$0] PRIMARY KEY CLUSTERED ([make_number], [client_db])"
+  ],
+  "model_to_fuels": [
+    "   [make_number] [int] NOT NULL",
+    "   [model_code] [varchar](100) NOT NULL",
+    "   [code] [varchar](10) NOT NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [model_to_fuels$0] PRIMARY KEY CLUSTERED ([make_number], [model_code], [code], [client_db])"
+  ],
+  "models": [
+    "   [make_number] [int] NOT NULL",
+    "   [model_code] [varchar](100) NOT NULL",
+    "   [is_actual_model] [smallint] NULL",
+    "   [model_currently_available] [smallint] NULL",
+    "   [replacing_model_code] [varchar](100) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [gear_count] [int] NULL",
+    "   [seat_count] [int] NULL",
+    "   [door_count] [int] NULL",
+    "   [cylinder_count] [int] NULL",
+    "   [vehicle_body] [varchar](10) NULL",
+    "   [model_labour_group] [varchar](50) NULL",
+    "   [has_hour_meter] [smallint] NULL",
+    "   [source_extern] [smallint] NULL",
+    "   [free_form_vehicle_class] [varchar](50) NULL",
+    "   [vin_begin] [varchar](50) NULL",
+    "   [vehicle_pool_code] [varchar](100) NULL",
+    "   [vehicle_pool_engine_code] [varchar](50) NULL",
+    "   [is_manual_transmission] [smallint] NULL",
+    "   [is_all_wheel_drive] [smallint] NULL",
+    "   [is_plugin_hybride] [smallint] NULL",
+    "   [unloaded_weight] [int] NULL",
+    "   [gross_vehicle_weight] [int] NULL",
+    "   [power_kw] [int] NULL",
+    "   [power_kw_at_rotation] [int] NULL",
+    "   [cubic_capacity] [int] NULL",
+    "   [german_kba_hsn] [varchar](50) NULL",
+    "   [german_kba_tsn] [varchar](50) NULL",
+    "   [annual_tax] [numeric](11,2) NULL",
+    "   [model_year] [numeric](6,0) NULL",
+    "   [model_year_postfix] [varchar](10) NULL",
+    "   [suggested_net_retail_price] [numeric](11,2) NULL",
+    "   [suggested_net_shipping_cost] [numeric](11,2) NULL",
+    "   [european_pollutant_class] [varchar](50) NULL",
+    "   [efficiency_class] [varchar](50) NULL",
+    "   [emission_code] [varchar](50) NULL",
+    "   [carbondioxid_emission] [int] NULL",
+    "   [nox_exhoust] [numeric](6,3) NULL",
+    "   [particle_exhoust] [numeric](6,3) NULL",
+    "   [external_schwacke_code] [varchar](100) NULL",
+    "   [skr_carrier_flag] [numeric](4,0) NULL",
+    "   [free_form_model_specification] [varchar](10) NULL",
+    "   [external_technical_type] [varchar](50) NULL",
+    "   [european_fuel_consumption_over] [numeric](6,2) NULL",
+    "   [european_fuel_consumption_coun] [numeric](6,2) NULL",
+    "   [european_fuel_consumption_city] [numeric](6,2) NULL",
+    "   [energy_consumption] [numeric](7,2) NULL",
+    "   [insurance_class_liability] [int] NULL",
+    "   [insurance_class_part_comprehen] [int] NULL",
+    "   [insurance_class_full_comprehen] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [models$0] PRIMARY KEY CLUSTERED ([make_number], [model_code], [client_db])"
+  ],
+  "nominal_accounts": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [nominal_account_number] [bigint] NOT NULL",
+    "   [account_description] [varchar](100) NULL",
+    "   [is_profit_loss_account] [varchar](100) NULL",
+    "   [vat_key] [varchar](100) NULL",
+    "   [create_date] [datetime] NULL",
+    "   [create_employee_number] [bigint] NULL",
+    "   [oldest_accountable_month] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [nominal_accounts$0] PRIMARY KEY CLUSTERED ([subsidiary_to_company_ref], [nominal_account_number], [client_db])"
+  ],
+  "orders": [
+    "   [number] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [order_date] [bigint] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [updated_employee_no] [int] NULL",
+    "   [estimated_inbound_time] [bigint] NULL",
+    "   [estimated_outbound_time] [bigint] NULL",
+    "   [order_print_date] [datetime] NULL",
+    "   [order_taking_employee_no] [int] NULL",
+    "   [order_delivery_employee_no] [int] NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [dealer_vehicle_type] [varchar](10) NULL",
+    "   [dealer_vehicle_number] [int] NULL",
+    "   [order_mileage] [int] NULL",
+    "   [order_customer] [int] NULL",
+    "   [paying_customer] [int] NULL",
+    "   [parts_rebate_group_sell] [int] NULL",
+    "   [clearing_delay_type] [varchar](10) NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [orders$0] PRIMARY KEY CLUSTERED ([number], [client_db])"
+  ],
+  "part_types": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [part_types$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "parts": [
+    "   [order_number] [int] NOT NULL",
+    "   [order_position] [int] NOT NULL",
+    "   [order_position_line] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [is_invoiced] [smallint] NULL",
+    "   [invoice_type] [int] NULL",
+    "   [invoice_number] [int] NULL",
+    "   [employee_no] [int] NULL",
+    "   [mechanic_no] [int] NULL",
+    "   [part_number] [varchar](100) NULL",
+    "   [stock_no] [int] NULL",
+    "   [stock_removal_date] [datetime] NULL",
+    "   [amount] [numeric](11,2) NULL",
+    "   [sum] [numeric](11,2) NULL",
+    "   [rebate_percent] [numeric](6,2) NULL",
+    "   [goodwill_percent] [numeric](6,1) NULL",
+    "   [parts_type] [int] NULL",
+    "   [text_line] [varchar](100) NULL",
+    "   [usage_value] [numeric](11,2) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts$0] PRIMARY KEY CLUSTERED ([order_number], [order_position], [order_position_line], [client_db])"
+  ],
+  "parts_inbound_delivery_notes": [
+    "   [supplier_number] [int] NOT NULL",
+    "   [year_key] [int] NOT NULL",
+    "   [number_main] [varchar](50) NOT NULL",
+    "   [number_sub] [varchar](50) NOT NULL",
+    "   [counter] [int] NOT NULL",
+    "   [purchase_invoice_year] [int] NULL",
+    "   [purchase_invoice_number] [varchar](50) NULL",
+    "   [part_number] [varchar](100) NULL",
+    "   [stock_no] [int] NULL",
+    "   [amount] [numeric](11,2) NULL",
+    "   [delivery_note_date] [datetime] NULL",
+    "   [parts_order_number] [int] NULL",
+    "   [parts_order_note] [varchar](50) NULL",
+    "   [deliverers_note] [varchar](50) NULL",
+    "   [referenced_order_number] [int] NULL",
+    "   [referenced_order_position] [int] NULL",
+    "   [referenced_order_line] [int] NULL",
+    "   [is_veryfied] [smallint] NULL",
+    "   [parts_order_type] [int] NULL",
+    "   [rr_gross_price] [numeric](11,2) NULL",
+    "   [purchase_total_net_price] [numeric](11,2) NULL",
+    "   [parts_type] [int] NULL",
+    "   [employee_number_veryfied] [int] NULL",
+    "   [employee_number_imported] [int] NULL",
+    "   [employee_number_last] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_inbound_delivery_notes$0] PRIMARY KEY CLUSTERED ([supplier_number], [year_key], [number_main], [number_sub], [counter], [client_db])"
+  ],
+  "parts_master": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [rebate_percent] [numeric](11,5) NULL",
+    "   [package_unit_type] [varchar](10) NULL",
+    "   [package_size] [int] NULL",
+    "   [delivery_size] [int] NULL",
+    "   [weight] [numeric](11,3) NULL",
+    "   [warranty_flag] [varchar](10) NULL",
+    "   [last_import_date] [datetime] NULL",
+    "   [price_valid_from_date] [datetime] NULL",
+    "   [storage_flag] [varchar](10) NULL",
+    "   [rebate_code] [varchar](50) NULL",
+    "   [parts_type] [int] NULL",
+    "   [manufacturer_parts_type] [varchar](50) NULL",
+    "   [rr_price] [numeric](11,3) NULL",
+    "   [price_surcharge_percent] [numeric](11,5) NULL",
+    "   [selling_price_base_upe] [smallint] NULL",
+    "   [is_price_based_on_usage_value] [smallint] NULL",
+    "   [is_price_based_on_spcl_price] [smallint] NULL",
+    "   [has_price_common_surcharge] [smallint] NULL",
+    "   [allow_price_under_margin] [smallint] NULL",
+    "   [allow_price_under_usage_value] [smallint] NULL",
+    "   [is_stock_neutral] [smallint] NULL",
+    "   [is_stock_neutral_usage_v] [smallint] NULL",
+    "   [skr_carrier_flag] [numeric](4,0) NULL",
+    "   [price_import_keeps_description] [smallint] NULL",
+    "   [country_of_origin] [varchar](50) NULL",
+    "   [manufacturer_assembly_group] [varchar](50) NULL",
+    "   [has_information_ref] [smallint] NULL",
+    "   [has_costs_ref] [smallint] NULL",
+    "   [has_special_prices_ref] [smallint] NULL",
+    "   [has_special_offer_ref] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_master$0] PRIMARY KEY CLUSTERED ([part_number], [client_db])"
+  ],
+  "parts_rebate_codes_buy": [
+    "   [rebate_group_code] [int] NOT NULL",
+    "   [rebate_code] [varchar](50) NOT NULL",
+    "   [rebate_code_counter] [int] NOT NULL",
+    "   [parts_type_boundary_from] [int] NULL",
+    "   [parts_type_boundary_until] [int] NULL",
+    "   [rebate_percent] [numeric](11,5) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_rebate_codes_buy$0] PRIMARY KEY CLUSTERED ([rebate_group_code], [rebate_code], [rebate_code_counter], [client_db])"
+  ],
+  "parts_rebate_codes_sell": [
+    "   [rebate_group_code] [int] NOT NULL",
+    "   [rebate_code] [varchar](50) NOT NULL",
+    "   [rebate_code_counter] [int] NOT NULL",
+    "   [parts_type_boundary_from] [int] NULL",
+    "   [parts_type_boundary_until] [int] NULL",
+    "   [rebate_percent] [numeric](11,5) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_rebate_codes_sell$0] PRIMARY KEY CLUSTERED ([rebate_group_code], [rebate_code], [rebate_code_counter], [client_db])"
+  ],
+  "parts_rebate_groups_buy": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_rebate_groups_buy$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "parts_rebate_groups_sell": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_rebate_groups_sell$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "parts_special_offer_prices": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [is_active] [smallint] NULL",
+    "   [valid_from_date] [datetime] NULL",
+    "   [valid_until_date] [datetime] NULL",
+    "   [price] [numeric](11,2) NULL",
+    "   [addition_percent] [numeric](11,5) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_special_offer_prices$0] PRIMARY KEY CLUSTERED ([part_number], [client_db])"
+  ],
+  "parts_special_prices": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [order_classification_flag] [varchar](10) NOT NULL",
+    "   [is_active] [smallint] NULL",
+    "   [price] [numeric](11,2) NULL",
+    "   [addition_percent] [numeric](11,5) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_special_prices$0] PRIMARY KEY CLUSTERED ([part_number], [order_classification_flag], [client_db])"
+  ],
+  "parts_stock": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [stock_no] [int] NOT NULL",
+    "   [storage_location_1] [varchar](50) NULL",
+    "   [storage_location_2] [varchar](50) NULL",
+    "   [usage_value] [numeric](11,2) NULL",
+    "   [stock_level] [numeric](10,2) NULL",
+    "   [stock_allocated] [numeric](10,2) NULL",
+    "   [minimum_stock_level] [numeric](10,2) NULL",
+    "   [has_warn_on_below_min_level] [smallint] NULL",
+    "   [maximum_stock_level] [int] NULL",
+    "   [stop_order_flag] [varchar](10) NULL",
+    "   [revenue_account_group] [varchar](50) NULL",
+    "   [average_sales_statstic] [numeric](7,2) NULL",
+    "   [sales_current_year] [numeric](10,2) NULL",
+    "   [sales_previous_year] [numeric](10,2) NULL",
+    "   [total_buy_value] [numeric](11,2) NULL",
+    "   [total_sell_value] [numeric](11,2) NULL",
+    "   [provider_flag] [varchar](10) NULL",
+    "   [last_outflow_date] [datetime] NULL",
+    "   [last_inflow_date] [datetime] NULL",
+    "   [unevaluated_inflow_positions] [int] NULL",
+    "   [is_disabled_in_parts_platforms] [smallint] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [parts_stock$0] PRIMARY KEY CLUSTERED ([part_number], [stock_no], [client_db])"
+  ],
+  "privacy_channels": [
+    "   [channel_code] [varchar](10) NOT NULL",
+    "   [is_business] [smallint] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [privacy_channels$0] PRIMARY KEY CLUSTERED ([channel_code], [client_db])"
+  ],
+  "privacy_details": [
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary_to_company_ref] [int] NOT NULL",
+    "   [make_name] [varchar](50) NOT NULL",
+    "   [scope_code] [varchar](10) NOT NULL",
+    "   [channel_code] [varchar](10) NOT NULL",
+    "   [is_agreed] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [privacy_details$0] PRIMARY KEY CLUSTERED ([customer_number], [subsidiary_to_company_ref], [make_name], [scope_code], [channel_code], [client_db])"
+  ],
+  "privacy_protection_consent": [
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary_to_company_ref] [int] NOT NULL",
+    "   [make_name] [varchar](50) NOT NULL",
+    "   [validity_date_start] [datetime] NULL",
+    "   [validity_date_end] [datetime] NULL",
+    "   [created_print_time] [bigint] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [last_change_print_time] [bigint] NULL",
+    "   [last_change_employee_no] [int] NULL",
+    "   [first_ackno_print_time] [bigint] NULL",
+    "   [first_ackno_employee_no] [int] NULL",
+    "   [last_ackno_print_time] [bigint] NULL",
+    "   [last_ackno_employee_no] [int] NULL",
+    "   [first_consent_print_time] [bigint] NULL",
+    "   [first_consent_employee_no] [int] NULL",
+    "   [last_consent_print_time] [bigint] NULL",
+    "   [last_consent_employee_no] [int] NULL",
+    "   [internal_id] [bigint] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [privacy_protection_consent$0] PRIMARY KEY CLUSTERED ([customer_number], [subsidiary_to_company_ref], [make_name], [client_db])"
+  ],
+  "privacy_scopes": [
+    "   [scope_code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [privacy_scopes$0] PRIMARY KEY CLUSTERED ([scope_code], [client_db])"
+  ],
+  "salutations": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [main_salutation] [varchar](100) NULL",
+    "   [title] [varchar](255) NULL",
+    "   [salutation_in_forms] [varchar](255) NULL",
+    "   [receiver_salutation] [varchar](255) NULL",
+    "   [full_salutation] [varchar](255) NULL",
+    "   [multiline_line_1] [varchar](255) NULL",
+    "   [multiline_line_2] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [salutations$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "subsidiaries": [
+    "   [subsidiary] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [subsidiary_to_company_ref] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [subsidiaries$0] PRIMARY KEY CLUSTERED ([subsidiary], [client_db])"
+  ],
+  "time_types": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [time_types$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "times": [
+    "   [employee_number] [int] NOT NULL",
+    "   [order_number] [int] NOT NULL",
+    "   [start_time] [bigint] NOT NULL",
+    "   [type] [int] NULL",
+    "   [order_positions] [varchar](50) NOT NULL",
+    "   [end_time] [bigint] NULL",
+    "   [duration_minutes] [int] NULL",
+    "   [exact_duration_seconds] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [times$0] PRIMARY KEY CLUSTERED ([employee_number], [order_number], [start_time], [order_positions], [client_db])"
+  ],
+  "vat_keys": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [vat_key] [varchar](100) NOT NULL",
+    "   [key_validity_date] [datetime] NULL",
+    "   [branch] [bigint] NULL",
+    "   [description] [varchar](100) NULL",
+    "   [vat_rate] [bigint] NULL",
+    "   [create_date] [datetime] NULL",
+    "   [vat_account] [bigint] NULL",
+    "   [advanced_turnover_tax_pos] [bigint] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [vat_keys$0] PRIMARY KEY CLUSTERED ([subsidiary_to_company_ref], [vat_key], [client_db])"
+  ],
+  "vehicle_bodys": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [vehicle_bodys$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "vehicle_buy_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [vehicle_buy_types$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "vehicle_pre_owned_codes": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [vehicle_pre_owned_codes$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "vehicle_sale_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [vehicle_sale_types$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "vehicle_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [is_new_or_similar] [smallint] NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [vehicle_types$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "vehicles": [
+    "   [internal_number] [int] NOT NULL",
+    "   [vin] [varchar](50) NULL",
+    "   [license_plate] [varchar](50) NULL",
+    "   [license_plate_country] [varchar](10) NULL",
+    "   [license_plate_season] [varchar](50) NULL",
+    "   [make_number] [int] NULL",
+    "   [free_form_make_text] [varchar](50) NULL",
+    "   [model_code] [varchar](100) NULL",
+    "   [free_form_model_text] [varchar](100) NULL",
+    "   [is_roadworthy] [smallint] NULL",
+    "   [is_customer_vehicle] [smallint] NULL",
+    "   [dealer_vehicle_type] [varchar](10) NULL",
+    "   [dealer_vehicle_number] [int] NULL",
+    "   [first_registration_date] [datetime] NULL",
+    "   [readmission_date] [datetime] NULL",
+    "   [next_service_date] [datetime] NULL",
+    "   [next_service_km] [int] NULL",
+    "   [next_service_miles] [int] NULL",
+    "   [production_year] [numeric](6,0) NULL",
+    "   [owner_number] [int] NULL",
+    "   [holder_number] [int] NULL",
+    "   [previous_owner_number] [int] NULL",
+    "   [previous_owner_counter] [int] NULL",
+    "   [last_holder_change_date] [datetime] NULL",
+    "   [german_kba_hsn] [varchar](50) NULL",
+    "   [german_kba_tsn] [varchar](50) NULL",
+    "   [austria_nat_code] [varchar](50) NULL",
+    "   [is_prefer_km] [smallint] NULL",
+    "   [mileage_km] [int] NULL",
+    "   [mileage_miles] [int] NULL",
+    "   [odometer_reading_date] [datetime] NULL",
+    "   [engine_number] [varchar](100) NULL",
+    "   [gear_number] [varchar](100) NULL",
+    "   [unloaded_weight] [int] NULL",
+    "   [gross_vehicle_weight] [int] NULL",
+    "   [power_kw] [int] NULL",
+    "   [cubic_capacity] [int] NULL",
+    "   [is_all_accidents_repaired] [smallint] NULL",
+    "   [accidents_counter] [int] NULL",
+    "   [has_tyre_pressure_sensor] [smallint] NULL",
+    "   [carkey_number] [varchar](50) NULL",
+    "   [internal_source_flag] [varchar](10) NULL",
+    "   [emission_code] [varchar](50) NULL",
+    "   [first_sold_country] [varchar](10) NULL",
+    "   [first_sold_dealer_code] [int] NULL",
+    "   [body_paint_code] [varchar](100) NULL",
+    "   [body_paint_description] [varchar](100) NULL",
+    "   [is_body_paint_metallic] [smallint] NULL",
+    "   [interior_paint_code] [varchar](100) NULL",
+    "   [interior_paint_description] [varchar](100) NULL",
+    "   [trim_code] [varchar](100) NULL",
+    "   [trim_description] [varchar](100) NULL",
+    "   [fine_dust_label] [varchar](10) NULL",
+    "   [internal_assignment] [varchar](50) NULL",
+    "   [ricambi_free_input] [varchar](100) NULL",
+    "   [document_number] [varchar](50) NULL",
+    "   [salesman_number] [int] NULL",
+    "   [sale_date] [datetime] NULL",
+    "   [next_emission_test_date] [datetime] NULL",
+    "   [next_general_inspection_date] [datetime] NULL",
+    "   [next_rust_inspection_date] [datetime] NULL",
+    "   [next_exceptional_inspection_da] [datetime] NULL",
+    "   [last_change_date] [datetime] NULL",
+    "   [last_change_employee_no] [int] NULL",
+    "   [created_date] [datetime] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [last_change_subsidiary] [int] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [vehicles$0] PRIMARY KEY CLUSTERED ([internal_number], [client_db])"
+  ],
+  "wtp_pickup_bring_type": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [wtp_pickup_bring_type$0] PRIMARY KEY CLUSTERED ([type], [client_db])"
+  ],
+  "wtp_progress_status": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [wtp_progress_status$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "wtp_urgency": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [wtp_urgency$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "wtp_vehicle_status": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [wtp_vehicle_status$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "year_calendar": [
+    "   [calendar_id] [int] NOT NULL",
+    "   [date] [datetime] NOT NULL",
+    "   [day_off_declaration] [int] NULL",
+    "   [is_school_holid] [smallint] NULL",
+    "   [is_public_holid] [smallint] NULL",
+    "   [day_note] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [year_calendar$0] PRIMARY KEY CLUSTERED ([calendar_id], [date], [client_db])"
+  ],
+  "year_calendar_day_off_codes": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [year_calendar_day_off_codes$0] PRIMARY KEY CLUSTERED ([code], [client_db])"
+  ],
+  "year_calendar_subsidiary_mapping": [
+    "   [subsidiary] [int] NOT NULL",
+    "   [year] [int] NOT NULL",
+    "   [calendar_id] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL",
+    "\n   CONSTRAINT [year_calendar_subsidiary_mapping$0] PRIMARY KEY CLUSTERED ([subsidiary], [year], [client_db])"
+  ]
+}

+ 1190 - 0
Tasks/scripts/schema.json

@@ -0,0 +1,1190 @@
+{
+  "absence_calendar": [
+    "   [employee_number] [int] NOT NULL",
+    "   [date] [datetime] NOT NULL",
+    "   [unique_dummy] [int] NOT NULL",
+    "   [type] [varchar](10) NULL",
+    "   [is_payed] [smallint] NULL",
+    "   [day_contingent] [numeric](6,2) NULL",
+    "   [reason] [varchar](10) NULL",
+    "   [booking_flag] [varchar](10) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "absence_reasons": [
+    "   [id] [varchar](10) NOT NULL",
+    "   [description] [varchar](50) NULL",
+    "   [is_annual_vacation] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "absence_types": [
+    "   [type] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "accounts_characteristics": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [skr51_branch] [bigint] NOT NULL",
+    "   [skr51_make] [bigint] NOT NULL",
+    "   [skr51_cost_center] [bigint] NOT NULL",
+    "   [skr51_sales_channel] [bigint] NOT NULL",
+    "   [skr51_cost_unit] [bigint] NOT NULL",
+    "   [skr51_brach_name] [varchar](100) NULL",
+    "   [skr51_make_description] [varchar](100) NULL",
+    "   [skr51_cost_center_name] [varchar](100) NULL",
+    "   [skr51_sales_channel_name] [varchar](100) NULL",
+    "   [skr51_cost_unit_name] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "appointments": [
+    "   [id] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [appointment_type] [int] NULL",
+    "   [customer_number] [int] NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [comment] [varchar](255) NULL",
+    "   [created_by_employee] [int] NULL",
+    "   [created_timestamp] [bigint] NULL",
+    "   [locked_by_employee] [int] NULL",
+    "   [blocked_timestamp] [bigint] NULL",
+    "   [bring_timestamp] [bigint] NULL",
+    "   [return_timestamp] [bigint] NULL",
+    "   [pseudo_customer_name] [varchar](255) NULL",
+    "   [pseudo_customer_country] [varchar](10) NULL",
+    "   [pseudo_customer_zip_code] [varchar](100) NULL",
+    "   [pseudo_customer_home_city] [varchar](100) NULL",
+    "   [pseudo_customer_home_street] [varchar](100) NULL",
+    "   [pseudo_vehicle_make_number] [int] NULL",
+    "   [pseudo_vehicle_make_text] [varchar](50) NULL",
+    "   [pseudo_model_code] [varchar](50) NULL",
+    "   [pseudo_model_text] [varchar](50) NULL",
+    "   [order_number] [int] NULL",
+    "   [is_customer_reminder_allowed] [smallint] NULL",
+    "   [customer_reminder_type] [varchar](100) NULL",
+    "   [customer_reminder_timestamp] [bigint] NULL",
+    "   [bring_duration] [int] NULL",
+    "   [bring_employee_no] [int] NULL",
+    "   [return_duration] [int] NULL",
+    "   [return_employee_no] [int] NULL",
+    "   [customer_pickup_bring] [int] NULL",
+    "   [is_general_inspection_service] [smallint] NULL",
+    "   [urgency] [int] NULL",
+    "   [vehicle_status] [int] NULL",
+    "   [progress_status] [int] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "appointments_text": [
+    "   [appointment_id] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "charge_type_descriptions": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "charge_types": [
+    "   [type] [int] NOT NULL",
+    "   [subsidiary] [int] NOT NULL",
+    "   [timeunit_rate] [numeric](11,3) NULL",
+    "   [department] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "clearing_delay_types": [
+    "   [type] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_customer_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [format] [varchar](10) NULL",
+    "   [length] [int] NULL",
+    "   [decimal] [int] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_customer_list": [
+    "   [customer_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [value_format] [varchar](10) NULL",
+    "   [value_text] [varchar](100) NULL",
+    "   [value_numeric] [numeric](20,9) NULL",
+    "   [value_date] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_vehicle_date": [
+    "   [vehicle_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [date] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_vehicle_date_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [month_increase_factor] [int] NULL",
+    "   [show_in_211_from_or_to] [varchar](10) NULL",
+    "   [is_backdate_on_exceeding] [smallint] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_vehicle_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [format] [varchar](10) NULL",
+    "   [length] [int] NULL",
+    "   [decimal] [int] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_vehicle_list": [
+    "   [vehicle_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [value_format] [varchar](10) NULL",
+    "   [value_text] [varchar](100) NULL",
+    "   [value_numeric] [numeric](20,9) NULL",
+    "   [value_date] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_vehicle_mileage": [
+    "   [vehicle_number] [int] NOT NULL",
+    "   [code] [varchar](50) NOT NULL",
+    "   [kilometer] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "codes_vehicle_mileage_def": [
+    "   [code] [varchar](50) NOT NULL",
+    "   [is_defined_by_dms] [smallint] NULL",
+    "   [mileage_increase_factor] [int] NULL",
+    "   [show_in_211_from_or_to] [varchar](10) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "com_number_types": [
+    "   [typ] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [is_office_number] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "configuration": [
+    "   [type] [varchar](100) NOT NULL",
+    "   [value_numeric] [bigint] NOT NULL",
+    "   [value_text] [varchar](255) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "configuration_numeric": [
+    "   [parameter_number] [int] NOT NULL",
+    "   [subsidiary] [int] NOT NULL",
+    "   [text_value] [varchar](50) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "countries": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [iso3166_alpha2] [varchar](10) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "customer_codes": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "customer_com_numbers": [
+    "   [customer_number] [int] NOT NULL",
+    "   [counter] [bigint] NOT NULL",
+    "   [com_type] [varchar](10) NULL",
+    "   [is_reference] [smallint] NULL",
+    "   [only_on_1st_tab] [smallint] NULL",
+    "   [address] [varchar](255) NULL",
+    "   [has_contact_person_fields] [smallint] NULL",
+    "   [contact_salutation] [varchar](100) NULL",
+    "   [contact_firstname] [varchar](255) NULL",
+    "   [contact_lastname] [varchar](255) NULL",
+    "   [contact_description] [varchar](255) NULL",
+    "   [note] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "customer_profession_codes": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "customer_supplier_bank_information": [
+    "   [customer_number] [int] NOT NULL",
+    "   [iban] [varchar](100) NULL",
+    "   [swift] [varchar](50) NULL",
+    "   [sepa_mandate_start_date] [datetime] NULL",
+    "   [note] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "customer_to_customercodes": [
+    "   [customer_number] [int] NOT NULL",
+    "   [customer_code] [int] NOT NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "customer_to_professioncodes": [
+    "   [customer_number] [int] NOT NULL",
+    "   [profession_code] [int] NOT NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "customers_suppliers": [
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [is_supplier] [smallint] NULL",
+    "   [is_natural_person] [smallint] NULL",
+    "   [is_dummy_customer] [smallint] NULL",
+    "   [salutation_code] [varchar](10) NULL",
+    "   [name_prefix] [varchar](100) NULL",
+    "   [first_name] [varchar](100) NULL",
+    "   [family_name] [varchar](100) NULL",
+    "   [name_postfix] [varchar](100) NULL",
+    "   [country_code] [varchar](10) NULL",
+    "   [zip_code] [varchar](100) NULL",
+    "   [home_city] [varchar](100) NULL",
+    "   [home_street] [varchar](100) NULL",
+    "   [contact_salutation_code] [varchar](10) NULL",
+    "   [contact_family_name] [varchar](100) NULL",
+    "   [contact_first_name] [varchar](100) NULL",
+    "   [contact_note] [varchar](100) NULL",
+    "   [contact_personal_known] [smallint] NULL",
+    "   [parts_rebate_group_buy] [int] NULL",
+    "   [parts_rebate_group_sell] [int] NULL",
+    "   [rebate_labour_percent] [numeric](11,5) NULL",
+    "   [rebate_material_percent] [numeric](11,5) NULL",
+    "   [rebate_new_vehicles_percent] [numeric](11,5) NULL",
+    "   [cash_discount_percent] [numeric](11,5) NULL",
+    "   [vat_id_number] [varchar](100) NULL",
+    "   [vat_id_number_checked_date] [datetime] NULL",
+    "   [vat_id_free_code_1] [int] NULL",
+    "   [vat_id_free_code_2] [int] NULL",
+    "   [birthday] [datetime] NULL",
+    "   [last_contact] [datetime] NULL",
+    "   [preferred_com_number_type] [varchar](10) NULL",
+    "   [created_date] [datetime] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [updated_date] [datetime] NULL",
+    "   [updated_employee_no] [int] NULL",
+    "   [name_updated_date] [datetime] NULL",
+    "   [name_updated_employee_no] [int] NULL",
+    "   [sales_assistant_employee_no] [int] NULL",
+    "   [service_assistant_employee_no] [int] NULL",
+    "   [parts_assistant_employee_no] [int] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "dealer_vehicles": [
+    "   [dealer_vehicle_type] [varchar](10) NOT NULL",
+    "   [dealer_vehicle_number] [int] NOT NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [location] [varchar](50) NULL",
+    "   [buyer_customer_no] [int] NULL",
+    "   [deregistration_date] [datetime] NULL",
+    "   [refinancing_start_date] [datetime] NULL",
+    "   [refinancing_end_date] [datetime] NULL",
+    "   [refinancing_value] [numeric](11,2) NULL",
+    "   [refinancing_refundment] [numeric](11,2) NULL",
+    "   [refinancing_bank_customer_no] [int] NULL",
+    "   [refinanc_interest_free_date] [datetime] NULL",
+    "   [in_subsidiary] [int] NULL",
+    "   [in_buy_salesman_number] [int] NULL",
+    "   [in_buy_order_no] [varchar](50) NULL",
+    "   [in_buy_order_no_date] [datetime] NULL",
+    "   [in_buy_invoice_no] [varchar](50) NULL",
+    "   [in_buy_invoice_no_date] [datetime] NULL",
+    "   [in_buy_edp_order_no] [varchar](50) NULL",
+    "   [in_buy_edp_order_no_date] [datetime] NULL",
+    "   [in_is_trade_in_ken] [varchar](10) NULL",
+    "   [in_is_trade_in_kom] [int] NULL",
+    "   [in_used_vehicle_buy_type] [varchar](10) NULL",
+    "   [in_buy_list_price] [numeric](11,2) NULL",
+    "   [in_arrival_date] [datetime] NULL",
+    "   [in_expected_arrival_date] [datetime] NULL",
+    "   [in_accounting_document_type] [varchar](10) NULL",
+    "   [in_accounting_document_number] [bigint] NULL",
+    "   [in_accounting_document_date] [datetime] NULL",
+    "   [in_acntg_exceptional_group] [varchar](50) NULL",
+    "   [in_acntg_cost_unit_new_vehicle] [numeric](4,0) NULL",
+    "   [in_accounting_make] [numeric](4,0) NULL",
+    "   [in_registration_reference] [varchar](50) NULL",
+    "   [in_expected_repair_cost] [numeric](11,2) NULL",
+    "   [in_order_status] [varchar](10) NULL",
+    "   [out_subsidiary] [int] NULL",
+    "   [out_is_ready_for_sale] [smallint] NULL",
+    "   [out_ready_for_sale_date] [datetime] NULL",
+    "   [out_sale_type] [varchar](10) NULL",
+    "   [out_sales_contract_number] [varchar](50) NULL",
+    "   [out_sales_contract_date] [datetime] NULL",
+    "   [out_is_sales_contract_confrmed] [smallint] NULL",
+    "   [out_salesman_number_1] [int] NULL",
+    "   [out_salesman_number_2] [int] NULL",
+    "   [out_desired_shipment_date] [datetime] NULL",
+    "   [out_is_registration_included] [smallint] NULL",
+    "   [out_recommended_retail_price] [numeric](11,2) NULL",
+    "   [out_extra_expenses] [numeric](11,2) NULL",
+    "   [out_sale_price] [numeric](11,2) NULL",
+    "   [out_sale_price_dealer] [numeric](11,2) NULL",
+    "   [out_sale_price_minimum] [numeric](11,2) NULL",
+    "   [out_sale_price_internet] [numeric](11,2) NULL",
+    "   [out_estimated_invoice_value] [numeric](11,2) NULL",
+    "   [out_discount_percent_vehicle] [numeric](11,5) NULL",
+    "   [out_discount_percent_accessory] [numeric](11,5) NULL",
+    "   [out_order_number] [int] NULL",
+    "   [out_invoice_type] [int] NULL",
+    "   [out_invoice_number] [int] NULL",
+    "   [out_invoice_date] [datetime] NULL",
+    "   [out_deposit_invoice_type] [int] NULL",
+    "   [out_deposit_invoice_number] [int] NULL",
+    "   [out_deposit_value] [numeric](11,2) NULL",
+    "   [out_license_plate] [varchar](50) NULL",
+    "   [out_make_number] [int] NULL",
+    "   [out_model_code] [varchar](100) NULL",
+    "   [out_license_plate_country] [varchar](10) NULL",
+    "   [out_license_plate_season] [varchar](50) NULL",
+    "   [calc_basic_charge] [numeric](11,2) NULL",
+    "   [calc_accessory] [numeric](11,2) NULL",
+    "   [calc_extra_expenses] [numeric](11,2) NULL",
+    "   [calc_usage_value_encr_external] [numeric](11,2) NULL",
+    "   [calc_usage_value_encr_internal] [numeric](11,2) NULL",
+    "   [calc_usage_value_encr_other] [numeric](11,2) NULL",
+    "   [calc_total_writedown] [numeric](11,2) NULL",
+    "   [calc_cost_percent_stockingdays] [numeric](5,0) NULL",
+    "   [calc_interest_percent_stkdays] [numeric](8,3) NULL",
+    "   [calc_actual_payed_interest] [numeric](11,2) NULL",
+    "   [calc_commission_for_arranging] [numeric](11,2) NULL",
+    "   [calc_commission_for_salesman] [numeric](11,2) NULL",
+    "   [calc_cost_internal_invoices] [numeric](11,2) NULL",
+    "   [calc_cost_other] [numeric](11,2) NULL",
+    "   [calc_sales_aid] [numeric](11,2) NULL",
+    "   [calc_sales_aid_finish] [numeric](11,2) NULL",
+    "   [calc_sales_aid_bonus] [numeric](11,2) NULL",
+    "   [calc_returns_workshop] [numeric](11,2) NULL",
+    "   [exclusive_reserved_employee_no] [int] NULL",
+    "   [exclusive_reserved_until] [datetime] NULL",
+    "   [pre_owned_car_code] [varchar](10) NULL",
+    "   [is_sale_internet] [smallint] NULL",
+    "   [is_sale_prohibit] [smallint] NULL",
+    "   [is_agency_business] [smallint] NULL",
+    "   [is_rental_or_school_vehicle] [smallint] NULL",
+    "   [previous_owner_number] [int] NULL",
+    "   [mileage_km] [int] NULL",
+    "   [memo] [varchar](255) NULL",
+    "   [keys_box_number] [int] NULL",
+    "   [last_change_date] [datetime] NULL",
+    "   [last_change_employee_no] [int] NULL",
+    "   [created_date] [datetime] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [has_financing_example] [smallint] NULL",
+    "   [has_leasing_example_ref] [smallint] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "document_types": [
+    "   [document_type_in_journal] [varchar](100) NOT NULL",
+    "   [document_type_description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "employees": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NULL",
+    "   [subsidiary] [int] NULL",
+    "   [has_constant_salary] [smallint] NULL",
+    "   [name] [varchar](100) NULL",
+    "   [initials] [varchar](10) NULL",
+    "   [customer_number] [int] NULL",
+    "   [mechanic_number] [int] NULL",
+    "   [salesman_number] [int] NULL",
+    "   [is_business_executive] [smallint] NULL",
+    "   [is_master_craftsman] [smallint] NULL",
+    "   [employment_date] [datetime] NULL",
+    "   [termination_date] [datetime] NULL",
+    "   [leave_date] [datetime] NULL",
+    "   [is_flextime] [smallint] NULL",
+    "   [break_time_registration] [varchar](50) NULL",
+    "   [productivity_factor] [numeric](4,1) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "employees_breaktimes": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NOT NULL",
+    "   [dayofweek] [int] NOT NULL",
+    "   [break_start] [numeric](7,3) NOT NULL",
+    "   [break_end] [numeric](7,3) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "employees_history": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [has_constant_salary] [smallint] NULL",
+    "   [name] [varchar](100) NULL",
+    "   [initials] [varchar](10) NULL",
+    "   [customer_number] [int] NULL",
+    "   [mechanic_number] [int] NULL",
+    "   [salesman_number] [int] NULL",
+    "   [is_business_executive] [smallint] NULL",
+    "   [is_master_craftsman] [smallint] NULL",
+    "   [employment_date] [datetime] NULL",
+    "   [termination_date] [datetime] NULL",
+    "   [leave_date] [datetime] NULL",
+    "   [is_flextime] [smallint] NULL",
+    "   [break_time_registration] [varchar](50) NULL",
+    "   [productivity_factor] [numeric](4,1) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "employees_worktimes": [
+    "   [is_latest_record] [smallint] NULL",
+    "   [employee_number] [int] NOT NULL",
+    "   [validity_date] [datetime] NOT NULL",
+    "   [dayofweek] [int] NOT NULL",
+    "   [work_duration] [numeric](7,3) NULL",
+    "   [worktime_start] [numeric](7,3) NULL",
+    "   [worktime_end] [numeric](7,3) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "external_customer_references": [
+    "   [api_type] [varchar](50) NOT NULL",
+    "   [api_id] [varchar](50) NOT NULL",
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary] [int] NOT NULL",
+    "   [reference] [varchar](255) NULL",
+    "   [last_received_time] [bigint] NULL",
+    "   [version] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "external_reference_parties": [
+    "   [api_type] [varchar](50) NOT NULL",
+    "   [api_id] [varchar](50) NOT NULL",
+    "   [make] [varchar](50) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "financing_examples": [
+    "   [id] [int] NOT NULL",
+    "   [initial_payment] [numeric](11,2) NULL",
+    "   [loan_amount] [numeric](11,2) NULL",
+    "   [number_rates] [int] NULL",
+    "   [annual_percentage_rate] [numeric](6,2) NULL",
+    "   [debit_interest] [numeric](6,2) NULL",
+    "   [debit_interest_type] [varchar](100) NULL",
+    "   [monthly_rate] [numeric](11,2) NULL",
+    "   [differing_first_rate] [numeric](11,2) NULL",
+    "   [last_rate] [numeric](11,2) NULL",
+    "   [rate_insurance] [numeric](11,2) NULL",
+    "   [acquisition_fee] [numeric](11,2) NULL",
+    "   [total] [numeric](11,2) NULL",
+    "   [interest_free_credit_until] [datetime] NULL",
+    "   [interest_free_credit_amount] [numeric](11,2) NULL",
+    "   [due_date] [int] NULL",
+    "   [due_date_last_rate] [int] NULL",
+    "   [bank_customer_no] [int] NULL",
+    "   [source] [varchar](50) NULL",
+    "   [referenced_dealer_vehicle_type] [varchar](10) NULL",
+    "   [referenced_dealer_vehicle_no] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "fuels": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "invoice_types": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "invoices": [
+    "   [invoice_type] [int] NOT NULL",
+    "   [invoice_number] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [order_number] [int] NULL",
+    "   [paying_customer] [int] NULL",
+    "   [invoice_date] [datetime] NULL",
+    "   [service_date] [datetime] NULL",
+    "   [is_canceled] [smallint] NULL",
+    "   [cancelation_number] [int] NULL",
+    "   [cancelation_date] [datetime] NULL",
+    "   [cancelation_employee] [int] NULL",
+    "   [is_own_vehicle] [smallint] NULL",
+    "   [is_credit] [smallint] NULL",
+    "   [credit_invoice_type] [int] NULL",
+    "   [credit_invoice_number] [int] NULL",
+    "   [odometer_reading] [int] NULL",
+    "   [creating_employee] [int] NULL",
+    "   [internal_cost_account] [int] NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [full_vat_basevalue] [numeric](11,2) NULL",
+    "   [full_vat_percentage] [numeric](6,2) NULL",
+    "   [full_vat_value] [numeric](20,2) NULL",
+    "   [reduced_vat_basevalue] [numeric](11,2) NULL",
+    "   [reduced_vat_percentage] [numeric](6,2) NULL",
+    "   [reduced_vat_value] [numeric](20,2) NULL",
+    "   [used_part_vat_value] [numeric](11,2) NULL",
+    "   [job_amount_net] [numeric](20,2) NULL",
+    "   [job_amount_gross] [numeric](20,2) NULL",
+    "   [job_rebate] [numeric](11,2) NULL",
+    "   [part_amount_net] [numeric](20,2) NULL",
+    "   [part_amount_gross] [numeric](20,2) NULL",
+    "   [part_rebate] [numeric](11,2) NULL",
+    "   [part_disposal] [numeric](11,2) NULL",
+    "   [total_gross] [numeric](20,2) NULL",
+    "   [total_net] [numeric](20,2) NULL",
+    "   [parts_rebate_group_sell] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "journal_accountings": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [accounting_date] [datetime] NOT NULL",
+    "   [document_type] [varchar](100) NOT NULL",
+    "   [document_number] [bigint] NOT NULL",
+    "   [position_in_document] [bigint] NOT NULL",
+    "   [customer_number] [bigint] NULL",
+    "   [nominal_account_number] [bigint] NULL",
+    "   [is_balanced] [varchar](100) NULL",
+    "   [clearing_number] [bigint] NULL",
+    "   [document_date] [datetime] NULL",
+    "   [posted_value] [bigint] NULL",
+    "   [debit_or_credit] [varchar](100) NULL",
+    "   [posted_count] [bigint] NULL",
+    "   [branch_number] [bigint] NULL",
+    "   [customer_contra_account] [bigint] NULL",
+    "   [nominal_contra_account] [bigint] NULL",
+    "   [contra_account_text] [varchar](100) NULL",
+    "   [account_form_page_number] [bigint] NULL",
+    "   [account_form_page_line] [bigint] NULL",
+    "   [serial_number_each_month] [bigint] NULL",
+    "   [employee_number] [bigint] NULL",
+    "   [invoice_date] [datetime] NULL",
+    "   [invoice_number] [varchar](100) NULL",
+    "   [dunning_level] [varchar](100) NULL",
+    "   [last_dunning_date] [datetime] NULL",
+    "   [journal_page] [bigint] NULL",
+    "   [journal_line] [bigint] NULL",
+    "   [cash_discount] [bigint] NULL",
+    "   [term_of_payment] [bigint] NULL",
+    "   [posting_text] [varchar](100) NULL",
+    "   [vehicle_reference] [varchar](100) NULL",
+    "   [vat_id_number] [varchar](100) NULL",
+    "   [account_statement_number] [bigint] NULL",
+    "   [account_statement_page] [bigint] NULL",
+    "   [vat_key] [varchar](100) NULL",
+    "   [days_for_cash_discount] [bigint] NULL",
+    "   [day_of_actual_accounting] [datetime] NULL",
+    "   [skr51_branch] [bigint] NULL",
+    "   [skr51_make] [bigint] NULL",
+    "   [skr51_cost_center] [bigint] NULL",
+    "   [skr51_sales_channel] [bigint] NULL",
+    "   [skr51_cost_unit] [bigint] NULL",
+    "   [previously_used_account_no] [varchar](100) NULL",
+    "   [free_form_accounting_text] [varchar](100) NULL",
+    "   [free_form_document_text] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "labour_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "labours": [
+    "   [order_number] [int] NOT NULL",
+    "   [order_position] [int] NOT NULL",
+    "   [order_position_line] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [is_invoiced] [smallint] NULL",
+    "   [invoice_type] [int] NULL",
+    "   [invoice_number] [int] NULL",
+    "   [employee_no] [int] NULL",
+    "   [mechanic_no] [int] NULL",
+    "   [labour_operation_id] [varchar](100) NULL",
+    "   [is_nominal] [smallint] NULL",
+    "   [time_units] [numeric](11,2) NULL",
+    "   [net_price_in_order] [numeric](11,2) NULL",
+    "   [rebate_percent] [numeric](6,2) NULL",
+    "   [goodwill_percent] [numeric](6,1) NULL",
+    "   [charge_type] [int] NULL",
+    "   [text_line] [varchar](255) NULL",
+    "   [usage_value] [numeric](11,2) NULL",
+    "   [negative_flag] [varchar](10) NULL",
+    "   [labour_type] [varchar](10) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "labours_compressed": [
+    "   [order_number] [int] NOT NULL",
+    "   [order_position] [int] NOT NULL",
+    "   [order_position_line_start] [int] NOT NULL",
+    "   [order_position_line_end] [int] NULL",
+    "   [labour_operation_id] [varchar](100) NULL",
+    "   [time_units] [numeric](11,2) NULL",
+    "   [net_price_in_order] [numeric](11,2) NULL",
+    "   [text] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "labours_groups": [
+    "   [source] [varchar](50) NOT NULL",
+    "   [labour_number_range] [varchar](50) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "labours_master": [
+    "   [source] [varchar](50) NOT NULL",
+    "   [labour_number] [varchar](50) NOT NULL",
+    "   [mapping_code] [varchar](50) NOT NULL",
+    "   [text] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "leasing_examples": [
+    "   [id] [int] NOT NULL",
+    "   [number_rates] [int] NULL",
+    "   [annual_mileage] [int] NULL",
+    "   [special_payment] [numeric](11,2) NULL",
+    "   [calculation_basis] [numeric](11,2) NULL",
+    "   [calculation_basis_factor] [numeric](6,2) NULL",
+    "   [gross_residual_value] [numeric](11,2) NULL",
+    "   [gross_residual_value_factor] [numeric](6,2) NULL",
+    "   [monthly_rate] [numeric](11,2) NULL",
+    "   [exceeding_mileage] [numeric](11,2) NULL",
+    "   [under_usage_mileage] [numeric](11,2) NULL",
+    "   [bank_customer_no] [int] NULL",
+    "   [source] [varchar](50) NULL",
+    "   [referenced_dealer_vehicle_type] [varchar](10) NULL",
+    "   [referenced_dealer_vehicle_no] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "makes": [
+    "   [make_number] [int] NOT NULL",
+    "   [is_actual_make] [smallint] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [group_name] [varchar](50) NULL",
+    "   [make_id_in_group] [varchar](50) NULL",
+    "   [internal_labour_group] [int] NULL",
+    "   [is_production_year_visible] [smallint] NULL",
+    "   [is_transmission_no_visible] [smallint] NULL",
+    "   [is_engine_no_visible] [smallint] NULL",
+    "   [is_ricambi_no_visible] [smallint] NULL",
+    "   [ricambi_label] [varchar](100) NULL",
+    "   [is_preset_finance_stock_rate] [smallint] NULL",
+    "   [rate_free_days_new_vehicle] [int] NULL",
+    "   [rate_free_days_demo_vehicle] [int] NULL",
+    "   [special_service_2_interval] [numeric](6,1) NULL",
+    "   [special_service_3_interval] [numeric](6,1) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "model_to_fuels": [
+    "   [make_number] [int] NOT NULL",
+    "   [model_code] [varchar](100) NOT NULL",
+    "   [code] [varchar](10) NOT NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "models": [
+    "   [make_number] [int] NOT NULL",
+    "   [model_code] [varchar](100) NOT NULL",
+    "   [is_actual_model] [smallint] NULL",
+    "   [model_currently_available] [smallint] NULL",
+    "   [replacing_model_code] [varchar](100) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [gear_count] [int] NULL",
+    "   [seat_count] [int] NULL",
+    "   [door_count] [int] NULL",
+    "   [cylinder_count] [int] NULL",
+    "   [vehicle_body] [varchar](10) NULL",
+    "   [model_labour_group] [varchar](50) NULL",
+    "   [has_hour_meter] [smallint] NULL",
+    "   [source_extern] [smallint] NULL",
+    "   [free_form_vehicle_class] [varchar](50) NULL",
+    "   [vin_begin] [varchar](50) NULL",
+    "   [vehicle_pool_code] [varchar](100) NULL",
+    "   [vehicle_pool_engine_code] [varchar](50) NULL",
+    "   [is_manual_transmission] [smallint] NULL",
+    "   [is_all_wheel_drive] [smallint] NULL",
+    "   [is_plugin_hybride] [smallint] NULL",
+    "   [unloaded_weight] [int] NULL",
+    "   [gross_vehicle_weight] [int] NULL",
+    "   [power_kw] [int] NULL",
+    "   [power_kw_at_rotation] [int] NULL",
+    "   [cubic_capacity] [int] NULL",
+    "   [german_kba_hsn] [varchar](50) NULL",
+    "   [german_kba_tsn] [varchar](50) NULL",
+    "   [annual_tax] [numeric](11,2) NULL",
+    "   [model_year] [numeric](6,0) NULL",
+    "   [model_year_postfix] [varchar](10) NULL",
+    "   [suggested_net_retail_price] [numeric](11,2) NULL",
+    "   [suggested_net_shipping_cost] [numeric](11,2) NULL",
+    "   [european_pollutant_class] [varchar](50) NULL",
+    "   [efficiency_class] [varchar](50) NULL",
+    "   [emission_code] [varchar](50) NULL",
+    "   [carbondioxid_emission] [int] NULL",
+    "   [nox_exhoust] [numeric](6,3) NULL",
+    "   [particle_exhoust] [numeric](6,3) NULL",
+    "   [external_schwacke_code] [varchar](100) NULL",
+    "   [skr_carrier_flag] [numeric](4,0) NULL",
+    "   [free_form_model_specification] [varchar](10) NULL",
+    "   [external_technical_type] [varchar](50) NULL",
+    "   [european_fuel_consumption_over] [numeric](6,2) NULL",
+    "   [european_fuel_consumption_coun] [numeric](6,2) NULL",
+    "   [european_fuel_consumption_city] [numeric](6,2) NULL",
+    "   [energy_consumption] [numeric](7,2) NULL",
+    "   [insurance_class_liability] [int] NULL",
+    "   [insurance_class_part_comprehen] [int] NULL",
+    "   [insurance_class_full_comprehen] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "nominal_accounts": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [nominal_account_number] [bigint] NOT NULL",
+    "   [account_description] [varchar](100) NULL",
+    "   [is_profit_loss_account] [varchar](100) NULL",
+    "   [vat_key] [varchar](100) NULL",
+    "   [create_date] [datetime] NULL",
+    "   [create_employee_number] [bigint] NULL",
+    "   [oldest_accountable_month] [datetime] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "orders": [
+    "   [number] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [order_date] [bigint] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [updated_employee_no] [int] NULL",
+    "   [estimated_inbound_time] [bigint] NULL",
+    "   [estimated_outbound_time] [bigint] NULL",
+    "   [order_print_date] [datetime] NULL",
+    "   [order_taking_employee_no] [int] NULL",
+    "   [order_delivery_employee_no] [int] NULL",
+    "   [vehicle_number] [int] NULL",
+    "   [dealer_vehicle_type] [varchar](10) NULL",
+    "   [dealer_vehicle_number] [int] NULL",
+    "   [order_mileage] [int] NULL",
+    "   [order_customer] [int] NULL",
+    "   [paying_customer] [int] NULL",
+    "   [parts_rebate_group_sell] [int] NULL",
+    "   [clearing_delay_type] [varchar](10) NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "part_types": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts": [
+    "   [order_number] [int] NOT NULL",
+    "   [order_position] [int] NOT NULL",
+    "   [order_position_line] [int] NOT NULL",
+    "   [subsidiary] [int] NULL",
+    "   [is_invoiced] [smallint] NULL",
+    "   [invoice_type] [int] NULL",
+    "   [invoice_number] [int] NULL",
+    "   [employee_no] [int] NULL",
+    "   [mechanic_no] [int] NULL",
+    "   [part_number] [varchar](100) NULL",
+    "   [stock_no] [int] NULL",
+    "   [stock_removal_date] [datetime] NULL",
+    "   [amount] [numeric](11,2) NULL",
+    "   [sum] [numeric](11,2) NULL",
+    "   [rebate_percent] [numeric](6,2) NULL",
+    "   [goodwill_percent] [numeric](6,1) NULL",
+    "   [parts_type] [int] NULL",
+    "   [text_line] [varchar](100) NULL",
+    "   [usage_value] [numeric](11,2) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_inbound_delivery_notes": [
+    "   [supplier_number] [int] NOT NULL",
+    "   [year_key] [int] NOT NULL",
+    "   [number_main] [varchar](50) NOT NULL",
+    "   [number_sub] [varchar](50) NOT NULL",
+    "   [counter] [int] NOT NULL",
+    "   [purchase_invoice_year] [int] NULL",
+    "   [purchase_invoice_number] [varchar](50) NULL",
+    "   [part_number] [varchar](100) NULL",
+    "   [stock_no] [int] NULL",
+    "   [amount] [numeric](11,2) NULL",
+    "   [delivery_note_date] [datetime] NULL",
+    "   [parts_order_number] [int] NULL",
+    "   [parts_order_note] [varchar](50) NULL",
+    "   [deliverers_note] [varchar](50) NULL",
+    "   [referenced_order_number] [int] NULL",
+    "   [referenced_order_position] [int] NULL",
+    "   [referenced_order_line] [int] NULL",
+    "   [is_veryfied] [smallint] NULL",
+    "   [parts_order_type] [int] NULL",
+    "   [rr_gross_price] [numeric](11,2) NULL",
+    "   [purchase_total_net_price] [numeric](11,2) NULL",
+    "   [parts_type] [int] NULL",
+    "   [employee_number_veryfied] [int] NULL",
+    "   [employee_number_imported] [int] NULL",
+    "   [employee_number_last] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_master": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [rebate_percent] [numeric](11,5) NULL",
+    "   [package_unit_type] [varchar](10) NULL",
+    "   [package_size] [int] NULL",
+    "   [delivery_size] [int] NULL",
+    "   [weight] [numeric](11,3) NULL",
+    "   [warranty_flag] [varchar](10) NULL",
+    "   [last_import_date] [datetime] NULL",
+    "   [price_valid_from_date] [datetime] NULL",
+    "   [storage_flag] [varchar](10) NULL",
+    "   [rebate_code] [varchar](50) NULL",
+    "   [parts_type] [int] NULL",
+    "   [manufacturer_parts_type] [varchar](50) NULL",
+    "   [rr_price] [numeric](11,3) NULL",
+    "   [price_surcharge_percent] [numeric](11,5) NULL",
+    "   [selling_price_base_upe] [smallint] NULL",
+    "   [is_price_based_on_usage_value] [smallint] NULL",
+    "   [is_price_based_on_spcl_price] [smallint] NULL",
+    "   [has_price_common_surcharge] [smallint] NULL",
+    "   [allow_price_under_margin] [smallint] NULL",
+    "   [allow_price_under_usage_value] [smallint] NULL",
+    "   [is_stock_neutral] [smallint] NULL",
+    "   [is_stock_neutral_usage_v] [smallint] NULL",
+    "   [skr_carrier_flag] [numeric](4,0) NULL",
+    "   [price_import_keeps_description] [smallint] NULL",
+    "   [country_of_origin] [varchar](50) NULL",
+    "   [manufacturer_assembly_group] [varchar](50) NULL",
+    "   [has_information_ref] [smallint] NULL",
+    "   [has_costs_ref] [smallint] NULL",
+    "   [has_special_prices_ref] [smallint] NULL",
+    "   [has_special_offer_ref] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_rebate_codes_buy": [
+    "   [rebate_group_code] [int] NOT NULL",
+    "   [rebate_code] [varchar](50) NOT NULL",
+    "   [rebate_code_counter] [int] NOT NULL",
+    "   [parts_type_boundary_from] [int] NULL",
+    "   [parts_type_boundary_until] [int] NULL",
+    "   [rebate_percent] [numeric](11,5) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_rebate_codes_sell": [
+    "   [rebate_group_code] [int] NOT NULL",
+    "   [rebate_code] [varchar](50) NOT NULL",
+    "   [rebate_code_counter] [int] NOT NULL",
+    "   [parts_type_boundary_from] [int] NULL",
+    "   [parts_type_boundary_until] [int] NULL",
+    "   [rebate_percent] [numeric](11,5) NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_rebate_groups_buy": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_rebate_groups_sell": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_special_offer_prices": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [is_active] [smallint] NULL",
+    "   [valid_from_date] [datetime] NULL",
+    "   [valid_until_date] [datetime] NULL",
+    "   [price] [numeric](11,2) NULL",
+    "   [addition_percent] [numeric](11,5) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_special_prices": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [order_classification_flag] [varchar](10) NOT NULL",
+    "   [is_active] [smallint] NULL",
+    "   [price] [numeric](11,2) NULL",
+    "   [addition_percent] [numeric](11,5) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "parts_stock": [
+    "   [part_number] [varchar](100) NOT NULL",
+    "   [stock_no] [int] NOT NULL",
+    "   [storage_location_1] [varchar](50) NULL",
+    "   [storage_location_2] [varchar](50) NULL",
+    "   [usage_value] [numeric](11,2) NULL",
+    "   [stock_level] [numeric](10,2) NULL",
+    "   [stock_allocated] [numeric](10,2) NULL",
+    "   [minimum_stock_level] [numeric](10,2) NULL",
+    "   [has_warn_on_below_min_level] [smallint] NULL",
+    "   [maximum_stock_level] [int] NULL",
+    "   [stop_order_flag] [varchar](10) NULL",
+    "   [revenue_account_group] [varchar](50) NULL",
+    "   [average_sales_statstic] [numeric](7,2) NULL",
+    "   [sales_current_year] [numeric](10,2) NULL",
+    "   [sales_previous_year] [numeric](10,2) NULL",
+    "   [total_buy_value] [numeric](11,2) NULL",
+    "   [total_sell_value] [numeric](11,2) NULL",
+    "   [provider_flag] [varchar](10) NULL",
+    "   [last_outflow_date] [datetime] NULL",
+    "   [last_inflow_date] [datetime] NULL",
+    "   [unevaluated_inflow_positions] [int] NULL",
+    "   [is_disabled_in_parts_platforms] [smallint] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "privacy_channels": [
+    "   [channel_code] [varchar](10) NOT NULL",
+    "   [is_business] [smallint] NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "privacy_details": [
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary_to_company_ref] [int] NOT NULL",
+    "   [make_name] [varchar](50) NOT NULL",
+    "   [scope_code] [varchar](10) NOT NULL",
+    "   [channel_code] [varchar](10) NOT NULL",
+    "   [is_agreed] [smallint] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "privacy_protection_consent": [
+    "   [customer_number] [int] NOT NULL",
+    "   [subsidiary_to_company_ref] [int] NOT NULL",
+    "   [make_name] [varchar](50) NOT NULL",
+    "   [validity_date_start] [datetime] NULL",
+    "   [validity_date_end] [datetime] NULL",
+    "   [created_print_time] [bigint] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [last_change_print_time] [bigint] NULL",
+    "   [last_change_employee_no] [int] NULL",
+    "   [first_ackno_print_time] [bigint] NULL",
+    "   [first_ackno_employee_no] [int] NULL",
+    "   [last_ackno_print_time] [bigint] NULL",
+    "   [last_ackno_employee_no] [int] NULL",
+    "   [first_consent_print_time] [bigint] NULL",
+    "   [first_consent_employee_no] [int] NULL",
+    "   [last_consent_print_time] [bigint] NULL",
+    "   [last_consent_employee_no] [int] NULL",
+    "   [internal_id] [bigint] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "privacy_scopes": [
+    "   [scope_code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "salutations": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [main_salutation] [varchar](100) NULL",
+    "   [title] [varchar](255) NULL",
+    "   [salutation_in_forms] [varchar](255) NULL",
+    "   [receiver_salutation] [varchar](255) NULL",
+    "   [full_salutation] [varchar](255) NULL",
+    "   [multiline_line_1] [varchar](255) NULL",
+    "   [multiline_line_2] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "subsidiaries": [
+    "   [subsidiary] [int] NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [subsidiary_to_company_ref] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "time_types": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "times": [
+    "   [employee_number] [int] NOT NULL",
+    "   [order_number] [int] NOT NULL",
+    "   [start_time] [bigint] NOT NULL",
+    "   [type] [int] NULL",
+    "   [order_positions] [varchar](50) NOT NULL",
+    "   [end_time] [bigint] NULL",
+    "   [duration_minutes] [int] NULL",
+    "   [exact_duration_seconds] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "vat_keys": [
+    "   [subsidiary_to_company_ref] [bigint] NOT NULL",
+    "   [vat_key] [varchar](100) NOT NULL",
+    "   [key_validity_date] [datetime] NULL",
+    "   [branch] [bigint] NULL",
+    "   [description] [varchar](100) NULL",
+    "   [vat_rate] [bigint] NULL",
+    "   [create_date] [datetime] NULL",
+    "   [vat_account] [bigint] NULL",
+    "   [advanced_turnover_tax_pos] [bigint] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "vehicle_bodys": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "vehicle_buy_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "vehicle_pre_owned_codes": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "vehicle_sale_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "vehicle_types": [
+    "   [code] [varchar](10) NOT NULL",
+    "   [is_new_or_similar] [smallint] NULL",
+    "   [description] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "vehicles": [
+    "   [internal_number] [int] NOT NULL",
+    "   [vin] [varchar](50) NULL",
+    "   [license_plate] [varchar](50) NULL",
+    "   [license_plate_country] [varchar](10) NULL",
+    "   [license_plate_season] [varchar](50) NULL",
+    "   [make_number] [int] NULL",
+    "   [free_form_make_text] [varchar](50) NULL",
+    "   [model_code] [varchar](100) NULL",
+    "   [free_form_model_text] [varchar](100) NULL",
+    "   [is_roadworthy] [smallint] NULL",
+    "   [is_customer_vehicle] [smallint] NULL",
+    "   [dealer_vehicle_type] [varchar](10) NULL",
+    "   [dealer_vehicle_number] [int] NULL",
+    "   [first_registration_date] [datetime] NULL",
+    "   [readmission_date] [datetime] NULL",
+    "   [next_service_date] [datetime] NULL",
+    "   [next_service_km] [int] NULL",
+    "   [next_service_miles] [int] NULL",
+    "   [production_year] [numeric](6,0) NULL",
+    "   [owner_number] [int] NULL",
+    "   [holder_number] [int] NULL",
+    "   [previous_owner_number] [int] NULL",
+    "   [previous_owner_counter] [int] NULL",
+    "   [last_holder_change_date] [datetime] NULL",
+    "   [german_kba_hsn] [varchar](50) NULL",
+    "   [german_kba_tsn] [varchar](50) NULL",
+    "   [austria_nat_code] [varchar](50) NULL",
+    "   [is_prefer_km] [smallint] NULL",
+    "   [mileage_km] [int] NULL",
+    "   [mileage_miles] [int] NULL",
+    "   [odometer_reading_date] [datetime] NULL",
+    "   [engine_number] [varchar](100) NULL",
+    "   [gear_number] [varchar](100) NULL",
+    "   [unloaded_weight] [int] NULL",
+    "   [gross_vehicle_weight] [int] NULL",
+    "   [power_kw] [int] NULL",
+    "   [cubic_capacity] [int] NULL",
+    "   [is_all_accidents_repaired] [smallint] NULL",
+    "   [accidents_counter] [int] NULL",
+    "   [has_tyre_pressure_sensor] [smallint] NULL",
+    "   [carkey_number] [varchar](50) NULL",
+    "   [internal_source_flag] [varchar](10) NULL",
+    "   [emission_code] [varchar](50) NULL",
+    "   [first_sold_country] [varchar](10) NULL",
+    "   [first_sold_dealer_code] [int] NULL",
+    "   [body_paint_code] [varchar](100) NULL",
+    "   [body_paint_description] [varchar](100) NULL",
+    "   [is_body_paint_metallic] [smallint] NULL",
+    "   [interior_paint_code] [varchar](100) NULL",
+    "   [interior_paint_description] [varchar](100) NULL",
+    "   [trim_code] [varchar](100) NULL",
+    "   [trim_description] [varchar](100) NULL",
+    "   [fine_dust_label] [varchar](10) NULL",
+    "   [internal_assignment] [varchar](50) NULL",
+    "   [ricambi_free_input] [varchar](100) NULL",
+    "   [document_number] [varchar](50) NULL",
+    "   [salesman_number] [int] NULL",
+    "   [sale_date] [datetime] NULL",
+    "   [next_emission_test_date] [datetime] NULL",
+    "   [next_general_inspection_date] [datetime] NULL",
+    "   [next_rust_inspection_date] [datetime] NULL",
+    "   [next_exceptional_inspection_da] [datetime] NULL",
+    "   [last_change_date] [datetime] NULL",
+    "   [last_change_employee_no] [int] NULL",
+    "   [created_date] [datetime] NULL",
+    "   [created_employee_no] [int] NULL",
+    "   [last_change_subsidiary] [int] NULL",
+    "   [lock_by_workstation] [int] NULL",
+    "   [lock_time] [bigint] NULL",
+    "   [lock_trace] [varchar](255) NULL",
+    "   [lock_trigger] [varchar](255) NULL",
+    "   [lock_by_employee] [int] NULL",
+    "   [lock_sourcecode] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "wtp_pickup_bring_type": [
+    "   [type] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "wtp_progress_status": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "wtp_urgency": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "wtp_vehicle_status": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "year_calendar": [
+    "   [calendar_id] [int] NOT NULL",
+    "   [date] [datetime] NOT NULL",
+    "   [day_off_declaration] [int] NULL",
+    "   [is_school_holid] [smallint] NULL",
+    "   [is_public_holid] [smallint] NULL",
+    "   [day_note] [varchar](100) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "year_calendar_day_off_codes": [
+    "   [code] [int] NOT NULL",
+    "   [description] [varchar](255) NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ],
+  "year_calendar_subsidiary_mapping": [
+    "   [subsidiary] [int] NOT NULL",
+    "   [year] [int] NOT NULL",
+    "   [calendar_id] [int] NULL",
+    "   [client_db] [varchar](20) NOT NULL"
+  ]
+}

+ 116 - 0
Tasks/scripts/schema.py

@@ -0,0 +1,116 @@
+import pyodbc
+import json
+
+def connect():
+	c = pyodbc.connect("DSN=Locosoft;UID=loco_auswertung_benutzer;PWD=loco")
+	return c.cursor()
+
+
+def convert_desc(col):
+	nullable = "NULL" if col.nullable == 1 else "NOT NULL"
+	if col.type_name in ('CHAR', 'varchar'):
+		return f'   [{col.column_name}] [varchar]({convert_len(col.length)}) {nullable}'
+	if col.type_name in ('HEX'):
+		return f'   [{col.column_name}] [binary]({col.length}) {nullable}'
+	if col.type_name in ('INTEGER', 'int4'):
+		return f'   [{col.column_name}] [int] {nullable}'
+	if col.type_name in ('INTEGER', 'int8', 'timestamp'):
+		return f'   [{col.column_name}] [bigint] {nullable}'
+	if col.type_name in ('DATE', 'date'):
+		return f'   [{col.column_name}] [datetime] {nullable}'
+	if col.type_name in ('NUMERIC', 'numeric'):
+		return f'   [{col.column_name}] [numeric]({col.length},{col.scale}) {nullable}'
+	if col.type_name in ('BIT', 'bool'):
+		return f'   [{col.column_name}] [smallint] {nullable}'		
+	if col.type_name in ('MEMO', 'text'):
+		return f'   [{col.column_name}] [varchar](100) {nullable}'			
+	return ", ".join(list(map(str, col)))
+
+
+def convert_len(length):
+	if length < 8:
+		return 10
+	if length < 38:
+		return 50
+	if length < 88:
+		return 100
+	return 255
+
+def convert_desc2(col):
+	return ", ".join(list(map(str, col)))
+# table_name = [x[2] for x in crsr.tables(tableType='VIEW')]
+# open("views.txt", "w").write("\n".join(table_name))
+
+with open("tables.txt", "r") as rh:
+	tables = rh.read().split("\n")
+res = {}
+
+	
+def tables_cols():
+	crsr = connect()
+	for t in tables:
+		try:
+			cols = crsr.columns(table=t)
+			# print([x[0] for x in crsr.description])
+			res[t] = [convert_desc(c) for c in cols]
+			res[t].append("   [client_db] [varchar](20) NOT NULL")
+			crsr.cancel()
+		except pyodbc.Error as e:
+			print(e)
+			if t != '':
+				res[t] = []
+			crsr = connect()
+
+	json.dump(res, open("schema.json", "w"), indent=2)
+
+	
+def pkeys():
+	crsr = connect()
+	for t in tables:
+		try:
+			cols = crsr.primaryKeys(table=t)
+			# print([x[0] for x in crsr.description])
+			if res.get(t) is None:
+				res[t] = []
+			
+			res[t].append(f"\n   CONSTRAINT [{t}$0] PRIMARY KEY CLUSTERED ([" + "], [".join([c.column_name for c in cols] + ['client_db']) + "])")
+			crsr.cancel()
+		except pyodbc.Error as e:
+			print(t)
+			print(e)
+			if t != '':
+				res[t] = []
+			crsr = connect()	
+	json.dump(res, open("pkeys.json", "w"), indent=2)
+
+	
+def fkeys():
+	crsr = connect()
+	for t in tables:
+		try:
+			cols = crsr.foreignKeys(table=t)
+			print([x[0] for x in crsr.description])
+			if res.get(t) is None:
+				res[t] = []
+			res[t].append([convert_desc2(c) for c in cols])
+			crsr.cancel()
+		except pyodbc.Error as e:
+			print(e)
+			if t != '':
+				res[t] = []
+			crsr = connect()	
+	
+	
+def tables_create():
+	for t, cols in res.items():
+		with open("../../System/LOCOSOFT/SQL/schema/LOCOSOFT/sql_load/" + t + ".sql", "w") as wh:
+			wh.write(f"CREATE TABLE [dbo].[{t}] (\n")
+			wh.write(",\n".join(cols))			
+			wh.write("\n)\n\nGO\n")
+
+
+if __name__ == '__main__':
+	tables_cols()
+	pkeys()
+	# fkeys()
+	tables_create()

+ 85 - 0
Tasks/scripts/tables.txt

@@ -0,0 +1,85 @@
+absence_calendar
+absence_reasons
+absence_types
+accounts_characteristics
+appointments
+appointments_text
+charge_type_descriptions
+charge_types
+clearing_delay_types
+codes_customer_def
+codes_customer_list
+codes_vehicle_date
+codes_vehicle_date_def
+codes_vehicle_def
+codes_vehicle_list
+codes_vehicle_mileage
+codes_vehicle_mileage_def
+com_number_types
+configuration
+configuration_numeric
+countries
+customer_codes
+customer_com_numbers
+customer_profession_codes
+customer_supplier_bank_information
+customer_to_customercodes
+customer_to_professioncodes
+customers_suppliers
+dealer_vehicles
+document_types
+employees
+employees_breaktimes
+employees_history
+employees_worktimes
+external_customer_references
+external_reference_parties
+financing_examples
+fuels
+invoice_types
+invoices
+journal_accountings
+labour_types
+labours
+labours_compressed
+labours_groups
+labours_master
+leasing_examples
+makes
+model_to_fuels
+models
+nominal_accounts
+orders
+part_types
+parts
+parts_inbound_delivery_notes
+parts_master
+parts_rebate_codes_buy
+parts_rebate_codes_sell
+parts_rebate_groups_buy
+parts_rebate_groups_sell
+parts_special_offer_prices
+parts_special_prices
+parts_stock
+privacy_channels
+privacy_details
+privacy_protection_consent
+privacy_scopes
+salutations
+subsidiaries
+time_types
+times
+vat_keys
+vehicle_bodys
+vehicle_buy_types
+vehicle_pre_owned_codes
+vehicle_sale_types
+vehicle_types
+vehicles
+wtp_pickup_bring_type
+wtp_progress_status
+wtp_urgency
+wtp_vehicle_status
+year_calendar
+year_calendar_day_off_codes
+year_calendar_subsidiary_mapping