/*

    Open DBDiff 0.9.0.0
    http://opendbiff.codeplex.com/

    Script created by shu00\Stefan Hutter lokal on 28.01.2019 at 11:12:25.

    Created on:  SHU00
    Source:      dpm_dental2smile on shu00
    Destination: DPM_Roellin on (local)

*/

USE [DPM_Roellin]
GO

UPDATE [dbo].[OPTIONS] SET [NROPTION] = 0 WHERE [NROPTION] IS NULL
GO
UPDATE [dbo].[OPTIONS] SET [Mandant] = 0 WHERE [Mandant] IS NULL
GO
UPDATE [dbo].[ORTE] SET [OrtNr] = 0 WHERE [OrtNr] IS NULL
GO
UPDATE [dbo].[leistung] SET [Nrleistung] = 0 WHERE [Nrleistung] IS NULL
GO
UPDATE [dbo].[LLFILES] SET [LLKEY] = '' WHERE [LLKEY] IS NULL
GO
UPDATE [dbo].[MELDUNG] SET [Nrmeldung] = 0 WHERE [Nrmeldung] IS NULL
GO
UPDATE [dbo].[PAKETPOS] SET [Nrpaketposition] = 0 WHERE [Nrpaketposition] IS NULL
GO
UPDATE [dbo].[RECHTEXT] SET [Nrrechnungstext] = 0 WHERE [Nrrechnungstext] IS NULL
GO
UPDATE [dbo].[Report] SET [Nrreport] = 0 WHERE [Nrreport] IS NULL
GO
UPDATE [dbo].[reportdb] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[privat] SET [NRPRIVAT] = 0 WHERE [NRPRIVAT] IS NULL
GO
UPDATE [dbo].[PUNKTE] SET [Nrtaxpunkte] = 0 WHERE [Nrtaxpunkte] IS NULL
GO
UPDATE [dbo].[RECALL] SET [Nrrecall] = 0 WHERE [Nrrecall] IS NULL
GO
UPDATE [dbo].[FAKTPOS] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[Faktura] SET [Nrfaktura] = 0 WHERE [Nrfaktura] IS NULL
GO
UPDATE [dbo].[FIRMA] SET [NRFIRMA] = 0 WHERE [NRFIRMA] IS NULL
GO
UPDATE [dbo].[BJOURNAL] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[DEBITOR] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[ESTYP] SET [NRESTYP] = 0 WHERE [NRESTYP] IS NULL
GO
UPDATE [dbo].[FIRMAAP] SET [NRFIRMAAP] = 0 WHERE [NRFIRMAAP] IS NULL
GO
UPDATE [dbo].[FUNKTION] SET [Nrfunktion] = 0 WHERE [Nrfunktion] IS NULL
GO
UPDATE [dbo].[INDEXES] SET [NREINTRAG] = 0 WHERE [NREINTRAG] IS NULL
GO
UPDATE [dbo].[KONTO] SET [Nrkonto] = 0 WHERE [Nrkonto] IS NULL
GO
UPDATE [dbo].[FJOURNAL] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[FORMFELD] SET [Nrfeld] = 0 WHERE [Nrfeld] IS NULL
GO
UPDATE [dbo].[FORMULAR] SET [Nrformular] = 0 WHERE [Nrformular] IS NULL
GO
UPDATE [dbo].[TEXTE] SET [Sprachcode] = '' WHERE [Sprachcode] IS NULL
GO
UPDATE [dbo].[TITEL] SET [NRTITEL] = 0 WHERE [NRTITEL] IS NULL
GO
UPDATE [dbo].[TMPKONTO] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[TAXPUNKT] SET [Nrtaxpunkt] = 0 WHERE [Nrtaxpunkt] IS NULL
GO
UPDATE [dbo].[TEXTE] SET [Nrtext] = 0 WHERE [Nrtext] IS NULL
GO
UPDATE [dbo].[TEXTE] SET [Mandant] = 0 WHERE [Mandant] IS NULL
GO
UPDATE [dbo].[tmppatlab] SET [NRPRIVAT] = 0 WHERE [NRPRIVAT] IS NULL
GO
UPDATE [dbo].[VDKonti] SET [NrPrivat] = 0 WHERE [NrPrivat] IS NULL
GO
UPDATE [dbo].[WORKLOG] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[Zahlung] SET [Nrzahlung] = 0 WHERE [Nrzahlung] IS NULL
GO
UPDATE [dbo].[TMPRCALL] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[TMPUMSA] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[USER] SET [User] = '' WHERE [User] IS NULL
GO
UPDATE [dbo].[sortlei] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[SPRACHE] SET [Sprachcode] = '' WHERE [Sprachcode] IS NULL
GO
UPDATE [dbo].[STATTEXT] SET [Nrstatustext] = 0 WHERE [Nrstatustext] IS NULL
GO
UPDATE [dbo].[Reports] SET [Nrreportgruppe] = 0 WHERE [Nrreportgruppe] IS NULL
GO
UPDATE [dbo].[RGTYP] SET [Nrrgtyp] = 0 WHERE [Nrrgtyp] IS NULL
GO
UPDATE [dbo].[ROLLENP] SET [Nrprivat] = 0 WHERE [Nrprivat] IS NULL
GO
UPDATE [dbo].[STATUSBH] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[TARIFE] SET [Nrtarifgruppe] = 0 WHERE [Nrtarifgruppe] IS NULL
GO
UPDATE [dbo].[Tarifgrp] SET [Nrtarifgruppe] = 0 WHERE [Nrtarifgruppe] IS NULL
GO
UPDATE [dbo].[TARPAKET] SET [Nrpaket] = 0 WHERE [Nrpaket] IS NULL
GO
UPDATE [dbo].[TAGPLAN] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[TARBUCH] SET [Eintrag] = 0 WHERE [Eintrag] IS NULL
GO
UPDATE [dbo].[TARIF] SET [Nrtarif] = 0 WHERE [Nrtarif] IS NULL
GO
UPDATE [dbo].[ANSATZ] SET [Nransatz] = 0 WHERE [Nransatz] IS NULL
GO
UPDATE [dbo].[BCART] SET [Nrbarcodeart] = 0 WHERE [Nrbarcodeart] IS NULL
GO
UPDATE [dbo].[BCFNKT] SET [Nrbcfunktion] = 0 WHERE [Nrbcfunktion] IS NULL
GO
UPDATE [dbo].[anzahlug] SET [Nranzahlung] = 0 WHERE [Nranzahlung] IS NULL
GO
UPDATE [dbo].[BARCODE] SET [Datum] = getdate() WHERE [Datum] IS NULL
GO
UPDATE [dbo].[BARCODE] SET [Bcnummer] = 0 WHERE [Bcnummer] IS NULL
GO
UPDATE [dbo].[BARCODE] SET [Mm] = 0 WHERE [Mm] IS NULL
GO
UPDATE [dbo].[BERECHT] SET [Nrberechtigung] = 0 WHERE [Nrberechtigung] IS NULL
GO
UPDATE [dbo].[BCPAGE] SET [Nrbcpage] = 0 WHERE [Nrbcpage] IS NULL
GO
UPDATE [dbo].[ANREDE] SET [NRANREDE] = 0 WHERE [NRANREDE] IS NULL
GO
UPDATE [dbo].[BARCODE] SET [Hh] = 0 WHERE [Hh] IS NULL
GO
UPDATE [dbo].[ABRTYP] SET [Nrabrechnungstyp] = 0 WHERE [Nrabrechnungstyp] IS NULL
GO
UPDATE [dbo].[BARCODES] SET [Nreintrag] = 0 WHERE [Nreintrag] IS NULL
GO
UPDATE [dbo].[BEHANDLU] SET [Nrbehandlung] = 0 WHERE [Nrbehandlung] IS NULL
GO
ALTER TABLE [dbo].[BARCODE] ALTER COLUMN [Datum] [date] NOT NULL
GO
ALTER TABLE [dbo].[BARCODE] ALTER COLUMN [Hh] [int] NOT NULL
GO
ALTER TABLE [dbo].[STATUSBH] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[VDKonti] ALTER COLUMN [NrPrivat] [int] NOT NULL
GO
ALTER TABLE [dbo].[STATTEXT] ALTER COLUMN [Nrstatustext] [int] NOT NULL
GO
ALTER TABLE [dbo].[SPRACHE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[STATTEXT] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[STATUSBH] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[USER] ALTER COLUMN [Passwort] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[TARBUCH] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BARCODE] ALTER COLUMN [Bcnummer] [int] NOT NULL
GO
ALTER TABLE [dbo].[TARIF] ALTER COLUMN [Bezf] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[TARIF] ALTER COLUMN [Bezd] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[TARIF] ALTER COLUMN [Nrtarif] [int] NOT NULL
GO
ALTER TABLE [dbo].[TARIF] ALTER COLUMN [Bezi] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[TAGPLAN] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[USER] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[Userid] [int] IDENTITY (1,1) NOT NULL
GO
ALTER TABLE [dbo].[TARBUCH] ALTER COLUMN [Eintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[USER] ALTER COLUMN [Name] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[TAGPLAN] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[SPRACHE] ALTER COLUMN [Sprachcode] [varchar] (1) COLLATE Latin1_General_CI_AS NOT NULL
GO
ALTER TABLE [dbo].[reportdb] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[Report] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BARCODES] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[Reports] ALTER COLUMN [Nrreportgruppe] [int] NOT NULL
GO
ALTER TABLE [dbo].[reportdb] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[WORKLOG] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[Report] ALTER COLUMN [Nrreport] [int] NOT NULL
GO
ALTER TABLE [dbo].[ABRTYP] ALTER COLUMN [Nrabrechnungstyp] [int] NOT NULL
GO
ALTER TABLE [dbo].[RECALL] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TMPRCALL] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[Zahlung] ALTER COLUMN [Nrzahlung] [int] NOT NULL
GO
ALTER TABLE [dbo].[RECHTEXT] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[RECHTEXT] ALTER COLUMN [Nrrechnungstext] [int] NOT NULL
GO
ALTER TABLE [dbo].[VDKonti] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[ROLLENP] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BARCODE] ALTER COLUMN [Mm] [int] NOT NULL
GO
ALTER TABLE [dbo].[ABRTYP] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[mit_datum] [bit] NULL
GO
ALTER TABLE [dbo].[sortlei] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[sortlei] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[ROLLENP] ALTER COLUMN [Nrprivat] [int] NOT NULL
GO
ALTER TABLE [dbo].[WORKLOG] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[Reports] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BARCODE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[RGTYP] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[RGTYP] ALTER COLUMN [Nrrgtyp] [int] NOT NULL
GO
ALTER TABLE [dbo].[Res] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Rabattwert] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 9000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 8000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Rabattbetrag] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Ratenzuschlag] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Gesamttotal] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Vorauszahlung] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 3000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 2000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 1000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 4000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 7000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 6000] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Total 5000] [float] NULL
GO
ALTER TABLE [dbo].[TMPRCALL] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TMPKONTO] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[ANREDE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[tmpop] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[ANREDE] ALTER COLUMN [NRANREDE] [int] NOT NULL
GO
ALTER TABLE [dbo].[tmppatlab] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[tmppatlab] ALTER COLUMN [NRPRIVAT] [int] NOT NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [MahnungRateRestTotal] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Teilzahlung] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Mahnzuschlag] [float] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ALTER COLUMN [Taxpunktwert] [float] NULL
GO
ALTER TABLE [dbo].[TMPKONTO] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[tmphaz] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[tmpfaktura] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[anzahlug] ALTER COLUMN [Nranzahlung] [int] NOT NULL
GO
ALTER TABLE [dbo].[TARPAKET] ALTER COLUMN [Nrpaket] [int] NOT NULL
GO
ALTER TABLE [dbo].[Tarifgrp] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TARPAKET] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[Absender] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TAXPUNKT] ALTER COLUMN [Nrtaxpunkt] [int] NOT NULL
GO
ALTER TABLE [dbo].[TMPUMSA] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TARIFE] ALTER COLUMN [Nrtarifgruppe] [int] NOT NULL
GO
ALTER TABLE [dbo].[USER] ALTER COLUMN [User] [varchar] (255) COLLATE Latin1_General_CI_AS NOT NULL
GO
ALTER TABLE [dbo].[TARIF] DROP COLUMN [SSO-Nummer]
GO
ALTER TABLE [dbo].[TARIF] ADD 
[SSO_Nummer] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[anzahlug] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[Tarifgrp] ALTER COLUMN [Nrtarifgruppe] [int] NOT NULL
GO
ALTER TABLE [dbo].[tmpzaz] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TARIFE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TITEL] ALTER COLUMN [NRTITEL] [int] NOT NULL
GO
ALTER TABLE [dbo].[tmprecallw] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TEXTE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[tmprecalle] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[tmpempf] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[tmpbesr] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TITEL] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[TEXTE] ALTER COLUMN [Nrtext] [int] NOT NULL
GO
ALTER TABLE [dbo].[TMPUMSA] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[TAXPUNKT] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[ANSATZ] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[ANSATZ] ALTER COLUMN [Nransatz] [int] NOT NULL
GO
ALTER TABLE [dbo].[TEXTE] ALTER COLUMN [Sprachcode] [varchar] (1) COLLATE Latin1_General_CI_AS NOT NULL
GO
ALTER TABLE [dbo].[TEXTE] ALTER COLUMN [Mandant] [int] NOT NULL
GO
ALTER TABLE [dbo].[Faktura] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[Faktura] ALTER COLUMN [Nrfaktura] [int] NOT NULL
GO
ALTER TABLE [dbo].[FAKTPOS] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[FIRMA] DROP COLUMN [E-Mail]
GO
ALTER TABLE [dbo].[FIRMA] ADD 
[E_Mail] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[GLN] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[Kanton] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[bemerkung] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[BEHANDLU] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[Unfalldatum] [datetime] NULL,
[Datum_Kostengutsprache] [datetime] NULL,
[Diagnose] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[GLN_Liste] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[Kostengutsprache_Nummer] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[Behandlungsgrund] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[NrZuweiser] [int] NULL,
[NrGesetz] [int] NULL,
[NrBehandlungsart] [int] NULL
GO
ALTER TABLE [dbo].[FIRMA] ALTER COLUMN [NRFIRMA] [int] NOT NULL
GO
ALTER TABLE [dbo].[ESTYP] ALTER COLUMN [NRESTYP] [int] NOT NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Gesamttotal] [float] NULL
GO
ALTER TABLE [dbo].[FAKTPOS] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[ESTYP] ADD 
[Default_rgtyp] [int] NULL,
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[Default_bei_KV] [bit] NULL,
[Default_bei_RG] [bit] NULL,
[Default_bei_KV_Dentotar] [bit] NULL,
[Default_bei_RG_Dentotar] [bit] NULL,
[mahnnummer] [int] NULL
GO
ALTER TABLE [dbo].[BERECHT] ALTER COLUMN [Nrberechtigung] [int] NOT NULL
GO
ALTER TABLE [dbo].[FORMULAR] ALTER COLUMN [Nrformular] [int] NOT NULL
GO
ALTER TABLE [dbo].[FORMFELD] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BEHANDLU] ALTER COLUMN [Nrbehandlung] [int] NOT NULL
GO
ALTER TABLE [dbo].[BCPAGE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[FUNKTION] ALTER COLUMN [Nrfunktion] [int] NOT NULL
GO
ALTER TABLE [dbo].[FORMULAR] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[FIRMAAP] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BEHANDLU] ALTER COLUMN [Bemerkung] [varchar] (2048) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[FIRMAAP] ALTER COLUMN [NRFIRMAAP] [int] NOT NULL
GO
ALTER TABLE [dbo].[FORMFELD] ALTER COLUMN [Nrfeld] [int] NOT NULL
GO
ALTER TABLE [dbo].[FJOURNAL] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[FJOURNAL] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[Calendar] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[Calendar] ALTER COLUMN [EndTime] [datetime] NULL
GO
ALTER TABLE [dbo].[Calendar] ALTER COLUMN [StartTime] [datetime] NULL
GO
ALTER TABLE [dbo].[DEBITOR] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[DEBITOR] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[CustDocs] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BESRT] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[Eintragnr] [int] IDENTITY (1,1) NOT NULL
GO
ALTER TABLE [dbo].[BESRI] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[NrEintrag] [int] IDENTITY (1,1) NOT NULL,
[besrtnr] [int] NULL
GO
ALTER TABLE [dbo].[BARCODES] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BJOURNAL] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BERECHT] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BJOURNAL] ALTER COLUMN [Nreintrag] [int] NOT NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 9000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 8000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 7000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Vorauszahlung] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Rabattbetrag] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Rabattwert] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 3000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 2000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 1000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 6000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 5000] [float] NULL
GO
ALTER TABLE [dbo].[DesignFaktura] ALTER COLUMN [Total 4000] [float] NULL
GO
ALTER TABLE [dbo].[FUNKTION] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[LLFILES] ALTER COLUMN [LLKEY] [varchar] (8) COLLATE Latin1_General_CI_AS NOT NULL
GO
ALTER TABLE [dbo].[BCART] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BCFNKT] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[ORTE] ALTER COLUMN [OrtNr] [int] NOT NULL
GO
ALTER TABLE [dbo].[ORTE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[leistung] DROP COLUMN [SSO-Nummer],[Mutiertam]
GO
ALTER TABLE [dbo].[leistung] ADD 
[SSO_Nummer] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[aktiv] [bit] NULL,
[NrBehandler] [int] NULL
GO
ALTER TABLE [dbo].[MONATE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[PAKETPOS] ALTER COLUMN [Nrpaketposition] [int] NOT NULL
GO
ALTER TABLE [dbo].[PAKETPOS] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[MELDUNG] ALTER COLUMN [Nrmeldung] [int] NOT NULL
GO
ALTER TABLE [dbo].[BCFNKT] ALTER COLUMN [Nrbcfunktion] [int] NOT NULL
GO
ALTER TABLE [dbo].[OPTIONS] ALTER COLUMN [NROPTION] [int] NOT NULL
GO
ALTER TABLE [dbo].[MELDUNG] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[OPTIONS] ALTER COLUMN [Mandant] [int] NOT NULL
GO
ALTER TABLE [dbo].[LLFILES] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[ZJOURNAL] ALTER COLUMN [Debitor] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[ZJOURNAL] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[pk] [int] IDENTITY (1,1) NOT NULL
GO
ALTER TABLE [dbo].[OPTIONS] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
UPDATE LEISTUNG SET MUTIERER='' WHERE MUTIERER='joli'
GO
ALTER TABLE [dbo].[leistung] ALTER COLUMN [mutierer] [int] NULL
GO
ALTER TABLE [dbo].[PUNKTE] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[Zahlung] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[BCPAGE] ALTER COLUMN [Nrbcpage] [int] NOT NULL
GO
ALTER TABLE [dbo].[KONTO] ALTER COLUMN [Nrkonto] [int] NOT NULL
GO
ALTER TABLE [dbo].[INDEXES] ALTER COLUMN [NREINTRAG] [int] NOT NULL
GO
ALTER TABLE [dbo].[MANDANT] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[RECALL] ALTER COLUMN [Nrrecall] [int] NOT NULL
GO
ALTER TABLE [dbo].[INDEXES] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[KONTO] ADD 
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL
GO
ALTER TABLE [dbo].[leistung] ALTER COLUMN [Nrleistung] [int] NOT NULL
GO
ALTER TABLE [dbo].[privat] DROP COLUMN [E-Mail]
GO
ALTER TABLE [dbo].[privat] ADD 
[E_Mail] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[erstellt_am] [datetime] NULL,
[mutiert_am] [datetime] NULL,
[mutierer] [int] NULL,
[aktiv] [bit] NULL,
[GLN] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
[Kanton] [varchar] (2559) COLLATE Latin1_General_CI_AS NULL,
[ZSR] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[privat] ALTER COLUMN [NRPRIVAT] [int] NOT NULL
GO
ALTER TABLE [dbo].[BCART] ALTER COLUMN [Nrbarcodeart] [int] NOT NULL
GO
ALTER TABLE [dbo].[PUNKTE] ALTER COLUMN [Nrtaxpunkte] [int] NOT NULL
GO
CREATE TABLE [dbo].[SQL_Statements]
(
	[NRSQL] [int] NOT NULL,
	[SQL] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[Beschreibung] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	CONSTRAINT [PK_SQL_Statements] PRIMARY KEY CLUSTERED
	(
		[NRSQL] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[VSKonti]
(
	[Nr] [int] NOT NULL,
	[VS_Konto] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
	[VS_Belegart] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
	[VS_Teilnehmernummer] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
	[VS_BesrID] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL,
	CONSTRAINT [PK_VSKonti] PRIMARY KEY CLUSTERED
	(
		[Nr] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[status]
(
	[NrStatus] [int] NOT NULL,
	[Status] [varchar] (45) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tmprechnung]
(
	[Fakturanr] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Anrede] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Empfaenger1] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Empfaenger2] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Empfaenger3] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Empfaenger4] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Empfaenger5] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Empfaenger6] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Bhvon] [varchar] (20) COLLATE Latin1_General_CI_AS NULL,
	[Bhbis] [varchar] (20) COLLATE Latin1_General_CI_AS NULL,
	[Fallnr] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Bemerkung] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Patientstring] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Total] [float] NULL,
	[Total1000] [float] NULL,
	[Total2000] [float] NULL,
	[Total3000] [float] NULL,
	[Total4000] [float] NULL,
	[Total5000] [float] NULL,
	[Total6000] [float] NULL,
	[Total7000] [float] NULL,
	[Total8000] [float] NULL,
	[Total9000] [float] NULL,
	[Ratenzuschlag] [float] NULL,
	[Mahnzuschlag] [float] NULL,
	[Rabatt] [float] NULL,
	[Rabattbetrag] [float] NULL,
	[Vorauszahlung] [float] NULL,
	[Frankenbetrag] [float] NULL,
	[Eskonto] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Franken] [float] NULL,
	[Rappen] [float] NULL,
	[Referenznrkurz] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Referenznr] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Fakturadatum] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[spalten]
(
	[SpalteNr] [int] IDENTITY (1,1) NOT NULL,
	[Tabelle] [varchar] (255) COLLATE Latin1_General_CI_AS NOT NULL,
	[Tabellenspalte] [varchar] (255) COLLATE Latin1_General_CI_AS NOT NULL,
	[Spalte] [varchar] (255) COLLATE Latin1_General_CI_AS NOT NULL,
	[Breite] [int] NOT NULL,
	[Reihenfolge] [int] NOT NULL,
	[TipText] [varchar] (255) COLLATE Latin1_General_CI_AS NOT NULL,
	[Nummer_Format] [varchar] (255) COLLATE Latin1_General_CI_AS NOT NULL,
	[Erstellt_am] [datetime] NOT NULL,
	[Mutiert_am] [datetime] NOT NULL,
	[Mutierer] [int] NOT NULL,
	[aktiv] [bit] NULL,
	[readonly] [bit] NULL,
	[AlsHacken] [bit] NULL,
	CONSTRAINT [PK_spalten] PRIMARY KEY CLUSTERED
	(
		[SpalteNr] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[TMPSORT]
(
	[Nummer] [int] NOT NULL,
	[Sortfeld1] [varchar] (100) COLLATE Latin1_General_CI_AS NOT NULL,
	[Sortfeld2] [varchar] (100) COLLATE Latin1_General_CI_AS NOT NULL,
	[Sortfeld3] [varchar] (100) COLLATE Latin1_General_CI_AS NOT NULL,
	[Sortfeld4] [varchar] (100) COLLATE Latin1_General_CI_AS NOT NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL,
	CONSTRAINT [PK_TMPSORT] PRIMARY KEY CLUSTERED
	(
		[Nummer] ASC,
		[Sortfeld1] ASC,
		[Sortfeld2] ASC,
		[Sortfeld3] ASC,
		[Sortfeld4] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CAMT_Run]
(
	[NrEIntrag] [int] IDENTITY (1,1) NOT NULL,
	[Datum] [datetime] NULL,
	[aktiv] [bit] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[sourcefile] [image] NULL,
	[Sourcefilename] [varchar] (8000) COLLATE Latin1_General_CI_AS NULL,
	CONSTRAINT [PK_CAMT_Run] PRIMARY KEY CLUSTERED
	(
		[NrEIntrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Geschlecht]
(
	[NrGeschlecht] [int] NOT NULL,
	[Geschlecht] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
	[aktiv] [bit] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[muierer] [int] NULL,
	CONSTRAINT [PK_Geschlecht] PRIMARY KEY CLUSTERED
	(
		[NrGeschlecht] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Dentotar_Parameter]
(
	[EintragNr] [int] NOT NULL,
	[Beschreibung] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Wert] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL,
	CONSTRAINT [PK_Dentotar_Parameter] PRIMARY KEY CLUSTERED
	(
		[EintragNr] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[_tmp]
(
	[NRSQL] [int] NOT NULL,
	[SQL] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[Beschreibung] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Behandlungsart]
(
	[nrbehandlungsart] [int] IDENTITY (1,1) NOT NULL,
	[Behandlungsart] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL,
	CONSTRAINT [PK_Behandlungsart] PRIMARY KEY CLUSTERED
	(
		[nrbehandlungsart] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[DentoTar]
(
	[KapitelLeistung] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Level] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[KapitelNrNeu] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[LeistungNrNeu] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[LeistungD] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[LeistungF] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[LeistungI] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[InterpretationD] [varchar] (max) COLLATE Latin1_General_CI_AS NULL,
	[InterpretationF] [varchar] (max) COLLATE Latin1_General_CI_AS NULL,
	[InterpretationI] [varchar] (max) COLLATE Latin1_General_CI_AS NULL,
	[Abrechnungseinheit] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[BetragInCHF] [nvarchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Taxpunkte_UV_MV_IV] [float] NULL,
	[PP_Min] [float] NULL,
	[PP_Privat] [float] NULL,
	[PP_Max] [float] NULL,
	[Gueltig_Von] [datetime] NULL,
	[Gueltig_Bis] [datetime] NULL,
	[pk] [int] IDENTITY (1,1) NOT NULL,
	CONSTRAINT [PK_DentoTar] PRIMARY KEY CLUSTERED
	(
		[pk] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Auswertung]
(
	[AuswertungNr] [int] NOT NULL,
	[ES_Typ] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Folge_Report] [int] NULL,
	[Folgereport_Sep_Druckjob] [bit] NULL,
	[Bezeichnung] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
	[Drucker] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Papierschacht] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Aktiv] [bit] NULL,
	[Erstellt_am] [datetime] NULL,
	[Mutiert_am] [datetime] NULL,
	[Mutierer] [int] NULL,
	[Report] [bit] NULL,
	[Filename] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Excel_Report] [bit] NULL,
	[SQL] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[SQLType] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
	[Beschreibung] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[Connectionstring_Subreport] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Reportdatei] [image] NULL,
	[Gruppe] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Design_Funktion] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Kopien] [int] NULL CONSTRAINT [DF_Auswertung_Kopeien] DEFAULT ((1)),
	CONSTRAINT [PK_Auswertung] PRIMARY KEY CLUSTERED
	(
		[AuswertungNr] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[_tmp_leistung]
(
	[Nrleistung] [int] NOT NULL,
	[Datum] [date] NULL,
	[Nrbehandlung] [int] NULL,
	[Mandant] [int] NULL,
	[Nrtarifgruppe] [int] NULL,
	[Nrtarif] [int] NULL,
	[SSO_Nummer] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Taxpunkte] [float] NULL,
	[Menge] [float] NULL,
	[Frankenprotaxpunkt] [float] NULL,
	[Absolut] [bit] NULL,
	[Total] [float] NULL,
	[Bezd] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Bezi] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Bezf] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[NrBehandler] [float] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[FData]
(
	[NrEintrag] [int] NOT NULL,
	[NRFaktura] [int] NULL,
	[Leistung_Datum] [date] NULL,
	[Leistung_Bezeichnung] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Leistung_SSONummer] [int] NULL,
	[Leistung_Menge] [int] NULL,
	[Leistung_Punkte] [int] NULL,
	[Leistung_Absolut] [bit] NULL,
	[Leistung_Franken] [float] NULL,
	[Rabatt] [float] NULL,
	[Taxpunktwert] [float] NULL,
	[Totalbetrag] [float] NULL,
	[Bemerkung] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[InsertTimeStamp] [date] NULL,
	[NrBehandler] [int] NULL,
	[Status] [int] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL,
	CONSTRAINT [PK_FData] PRIMARY KEY CLUSTERED
	(
		[NrEintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Gesetz]
(
	[NrGesetz] [int] IDENTITY (1,1) NOT NULL,
	[Gesetz] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[aktiv] [bit] NULL,
	CONSTRAINT [PK_Gesetz] PRIMARY KEY CLUSTERED
	(
		[NrGesetz] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Log]
(
	[nreintrag] [int] IDENTITY (1,1) NOT NULL,
	[ts] [datetime] NULL,
	[Eintrag] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[Logtype] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CAMT_File]
(
	[Nreintrag] [int] IDENTITY (1,1) NOT NULL,
	[CAMT_RunNr] [int] NULL,
	[Filename] [varchar] (8000) COLLATE Latin1_General_CI_AS NULL,
	[CAMT_File] [image] NULL,
	[CreateDateTime] [datetime] NULL,
	[IBAN] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[REF] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Anzahl_Buchungen] [int] NULL,
	[ID] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Total] [float] NULL,
	[aktiv] [bit] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	CONSTRAINT [PK_CAMT_File] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Ortsverzeichnis]
(
	[PLZ] [float] NULL,
	[Ort] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Kanton] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[KT] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Land] [varchar] (255) COLLATE Latin1_General_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CAMT_Record]
(
	[nreintrag] [int] IDENTITY (1,1) NOT NULL,
	[CAMT_FileNr] [int] NULL,
	[Referenz] [varchar] (255) COLLATE Latin1_General_CI_AS NULL,
	[Valuta] [datetime] NULL,
	[Buchungsdatum] [datetime] NULL,
	[Betrag] [float] NULL,
	[Taxen] [float] NULL,
	[aktiv] [bit] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	[verbucht] [bit] NULL,
	CONSTRAINT [PK_CAMT_Record] PRIMARY KEY CLUSTERED
	(
		[nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[__Log]
(
	[_nreintrag] [int] IDENTITY (1,1) NOT NULL,
	[Logeintrag] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	CONSTRAINT [PK___Log] PRIMARY KEY CLUSTERED
	(
		[_nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[KG]
(
	[NrKG] [int] IDENTITY (1,1) NOT NULL,
	[NrPrivat] [int] NULL,
	[Datum] [datetime] NULL,
	[Beschreibung] [varchar] (4096) COLLATE Latin1_General_CI_AS NULL,
	[Bemerkung] [varchar] (1024) COLLATE Latin1_General_CI_AS NULL,
	[aktiv] [bit] NULL,
	[erstellt_am] [datetime] NULL,
	[mutiert_am] [datetime] NULL,
	[mutierer] [int] NULL,
	CONSTRAINT [PK_KG] PRIMARY KEY CLUSTERED
	(
		[NrKG] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE NONCLUSTERED INDEX [idx_debitor] ON [dbo].[Zahlung]
(
	[Nrdebitor] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_debitor] ON [dbo].[Faktura]
(
	[Nrdebitor] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_vz] ON [dbo].[Zahlung]
(
	[aktiv] ASC,
	[Vorauszahlung] ASC,
	[Nrbehandlung] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_nrprivat] ON [dbo].[BEHANDLU]
(
	[Nrpatient] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_nrbehandlung] ON [dbo].[leistung]
(
	[Nrbehandlung] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_behandlung] ON [dbo].[Faktura]
(
	[Nrbehandlung] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_nrfaktura] ON [dbo].[Zahlung]
(
	[Nrfaktura] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ZJOURNAL] ADD CONSTRAINT [PK_ZJOURNAL] PRIMARY KEY CLUSTERED
	(
		[pk] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ABRTYP] ADD CONSTRAINT [PK_ABRTYP] PRIMARY KEY CLUSTERED
	(
		[Nrabrechnungstyp] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[WORKLOG] ADD CONSTRAINT [PK_WORKLOG] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPRCALL] ADD CONSTRAINT [PK_TMPRCALL] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[VDKonti] ADD CONSTRAINT [PK_VDKonti] PRIMARY KEY CLUSTERED
	(
		[NrPrivat] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Zahlung] ADD CONSTRAINT [PK_Zahlung] PRIMARY KEY CLUSTERED
	(
		[Nrzahlung] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[USER] ADD CONSTRAINT [PK_USER] PRIMARY KEY CLUSTERED
	(
		[Userid] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPUMSA] ADD CONSTRAINT [PK_TMPUMSA] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[KONTO] ADD CONSTRAINT [PK_KONTO] PRIMARY KEY CLUSTERED
	(
		[Nrkonto] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BCFNKT] ADD CONSTRAINT [PK_BCFNKT] PRIMARY KEY CLUSTERED
	(
		[Nrbcfunktion] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[leistung] ADD CONSTRAINT [PK_LEISTUNG] PRIMARY KEY CLUSTERED
	(
		[Nrleistung] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[INDEXES] ADD CONSTRAINT [PK_INDEXES] PRIMARY KEY CLUSTERED
	(
		[NREINTRAG] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BCPAGE] ADD CONSTRAINT [PK_BCPAGE] PRIMARY KEY CLUSTERED
	(
		[Nrbcpage] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FORMULAR] ADD CONSTRAINT [PK_FORMULAR] PRIMARY KEY CLUSTERED
	(
		[Nrformular] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FUNKTION] ADD CONSTRAINT [PK_FUNKTION] PRIMARY KEY CLUSTERED
	(
		[Nrfunktion] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ORTE] ADD CONSTRAINT [PK_ORTE] PRIMARY KEY CLUSTERED
	(
		[OrtNr] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PAKETPOS] ADD CONSTRAINT [PK_PAKETPOS] PRIMARY KEY CLUSTERED
	(
		[Nrpaketposition] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[privat] ADD CONSTRAINT [PK_PRIVAT] PRIMARY KEY CLUSTERED
	(
		[NRPRIVAT] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OPTIONS] ADD CONSTRAINT [PK_OPTIONS] PRIMARY KEY CLUSTERED
	(
		[NROPTION] ASC,
		[Mandant] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[LLFILES] ADD CONSTRAINT [PK_LLFILES] PRIMARY KEY CLUSTERED
	(
		[LLKEY] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MELDUNG] ADD CONSTRAINT [PK_MELDUNG] PRIMARY KEY CLUSTERED
	(
		[Nrmeldung] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BCART] ADD CONSTRAINT [PK_BCART] PRIMARY KEY CLUSTERED
	(
		[Nrbarcodeart] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Calendar] ADD CONSTRAINT [PK_Calendar] PRIMARY KEY CLUSTERED
	(
		[ItemID] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DEBITOR] ADD CONSTRAINT [PK_DEBITOR] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ESTYP] ADD CONSTRAINT [PK_ESTYP] PRIMARY KEY CLUSTERED
	(
		[NRESTYP] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BJOURNAL] ADD CONSTRAINT [PK_BJOURNAL] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BERECHT] ADD CONSTRAINT [PK_BERECHT] PRIMARY KEY CLUSTERED
	(
		[Nrberechtigung] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BESRI] ADD CONSTRAINT [PK_BESRI] PRIMARY KEY CLUSTERED
	(
		[NrEintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BESRT] ADD CONSTRAINT [PK_BESRT] PRIMARY KEY CLUSTERED
	(
		[Eintragnr] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FIRMAAP] ADD CONSTRAINT [PK_FIRMAAP] PRIMARY KEY CLUSTERED
	(
		[NRFIRMAAP] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FJOURNAL] ADD CONSTRAINT [PK_FJOURNAL] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FORMFELD] ADD CONSTRAINT [PK_FORMFELD] PRIMARY KEY CLUSTERED
	(
		[Nrfeld] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FIRMA] ADD CONSTRAINT [PK_FIRMA] PRIMARY KEY CLUSTERED
	(
		[NRFIRMA] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[FAKTPOS] ADD CONSTRAINT [PK_FAKTPOS] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BEHANDLU] ADD CONSTRAINT [PK_Behandlu] PRIMARY KEY CLUSTERED
	(
		[Nrbehandlung] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Faktura] ADD CONSTRAINT [PK_Faktura] PRIMARY KEY CLUSTERED
	(
		[Nrfaktura] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TARIF] ADD CONSTRAINT [PK_TARIF] PRIMARY KEY CLUSTERED
	(
		[Nrtarif] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[anzahlug] ADD CONSTRAINT [PK_anzahlug] PRIMARY KEY CLUSTERED
	(
		[Nranzahlung] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Tarifgrp] ADD CONSTRAINT [PK_Tarifgrp] PRIMARY KEY CLUSTERED
	(
		[Nrtarifgruppe] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TARIFE] ADD CONSTRAINT [PK_TARIFE] PRIMARY KEY CLUSTERED
	(
		[Nrtarifgruppe] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[STATUSBH] ADD CONSTRAINT [PK_STATUSBH] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[STATTEXT] ADD CONSTRAINT [PK_STATTEXT] PRIMARY KEY CLUSTERED
	(
		[Nrstatustext] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TARBUCH] ADD CONSTRAINT [PK_TARBUCH] PRIMARY KEY CLUSTERED
	(
		[Eintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TAGPLAN] ADD CONSTRAINT [PK_TAGPLAN] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TITEL] ADD CONSTRAINT [PK_TITEL] PRIMARY KEY CLUSTERED
	(
		[NRTITEL] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ANREDE] ADD CONSTRAINT [PK_ANREDE] PRIMARY KEY CLUSTERED
	(
		[NRANREDE] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tmppatlab] ADD CONSTRAINT [PK_tmppatlab] PRIMARY KEY CLUSTERED
	(
		[NRPRIVAT] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPKONTO] ADD CONSTRAINT [PK_TMPKONTO] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ANSATZ] ADD CONSTRAINT [PK_ANSATZ] PRIMARY KEY CLUSTERED
	(
		[Nransatz] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TARPAKET] ADD CONSTRAINT [PK_TARPAKET] PRIMARY KEY CLUSTERED
	(
		[Nrpaket] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TEXTE] ADD CONSTRAINT [PK_TEXTE] PRIMARY KEY CLUSTERED
	(
		[Nrtext] ASC,
		[Mandant] ASC,
		[Sprachcode] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TAXPUNKT] ADD CONSTRAINT [PK_TAXPUNKT] PRIMARY KEY CLUSTERED
	(
		[Nrtaxpunkt] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SPRACHE] ADD CONSTRAINT [PK_SPRACHE] PRIMARY KEY CLUSTERED
	(
		[Sprachcode] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RECHTEXT] ADD CONSTRAINT [PK_RECHTEXT] PRIMARY KEY CLUSTERED
	(
		[Nrrechnungstext] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Reports] ADD CONSTRAINT [PK_Reports] PRIMARY KEY CLUSTERED
	(
		[Nrreportgruppe] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ROLLENP] ADD CONSTRAINT [PK_ROLLENP] PRIMARY KEY CLUSTERED
	(
		[Nrprivat] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Report] ADD CONSTRAINT [PK_Report] PRIMARY KEY CLUSTERED
	(
		[Nrreport] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RGTYP] ADD CONSTRAINT [PK_RGTYP] PRIMARY KEY CLUSTERED
	(
		[Nrrgtyp] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BARCODE] ADD CONSTRAINT [PK_BARCODE] PRIMARY KEY CLUSTERED
	(
		[Bcnummer] ASC,
		[Datum] ASC,
		[Hh] ASC,
		[Mm] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RECALL] ADD CONSTRAINT [PK_RECALL] PRIMARY KEY CLUSTERED
	(
		[Nrrecall] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[reportdb] ADD CONSTRAINT [PK_reportdb] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BARCODES] ADD CONSTRAINT [PK_BARCODES] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[sortlei] ADD CONSTRAINT [PK_sortlei] PRIMARY KEY CLUSTERED
	(
		[Nreintrag] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PUNKTE] ADD CONSTRAINT [PK_PUNKTE] PRIMARY KEY CLUSTERED
	(
		[Nrtaxpunkte] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
