CREATE TABLE [import].[Werkstattzeile] (
   [timestamp] [binary](8) NOT NULL,
   [Belegart] [int] NOT NULL,
   [Belegnr_] [varchar](20) NOT NULL,
   [Zeilennr_] [int] NOT NULL,
   [Verk_ an Deb_-Nr_] [varchar](20) NOT NULL,
   [Art] [int] NOT NULL,
   [Nr_] [varchar](20) NOT NULL,
   [Lagerortcode] [varchar](10) NOT NULL,
   [Buchungsgruppe] [varchar](10) NOT NULL,
   [Mengenrabattcode] [varchar](20) NOT NULL,
   [Auftragsdatum] [datetime] NOT NULL,
   [Beschreibung] [varchar](100) NOT NULL,
   [Beschreibung 2] [varchar](100) NOT NULL,
   [Einheit] [varchar](10) NOT NULL,
   [Menge] [decimal](38,20) NOT NULL,
   [Restauftragsmenge] [decimal](38,20) NOT NULL,
   [Zu fakturieren] [decimal](38,20) NOT NULL,
   [Zu liefern] [decimal](38,20) NOT NULL,
   [VK-Preis] [decimal](38,20) NOT NULL,
   [Einstandspreis (MW)] [decimal](38,20) NOT NULL,
   [MWSt %] [decimal](38,20) NOT NULL,
   [Mengenrabatt %] [decimal](38,20) NOT NULL,
   [Zeilenrabatt %] [decimal](38,20) NOT NULL,
   [Zeilenrabattbetrag] [decimal](38,20) NOT NULL,
   [Betrag] [decimal](38,20) NOT NULL,
   [Betrag inkl_ MWSt] [decimal](38,20) NOT NULL,
   [Bruttogewicht] [decimal](38,20) NOT NULL,
   [Nettogewicht] [decimal](38,20) NOT NULL,
   [Anzahl pro Paket] [decimal](38,20) NOT NULL,
   [Volumen] [decimal](38,20) NOT NULL,
   [Ausgleich mit Artikelposten] [int] NOT NULL,
   [Kostenstellencode] [varchar](10) NOT NULL,
   [Markencode] [varchar](10) NOT NULL,
   [Preisgruppencode] [varchar](10) NOT NULL,
   [Mengenrabatt zulassen] [tinyint] NOT NULL,
   [Seriennr_] [varchar](20) NOT NULL,
   [Deb_-_Artikelrabatt %] [decimal](38,20) NOT NULL,
   [Restauftragsbetrag] [decimal](38,20) NOT NULL,
   [Lief_ nicht fakt_ Menge] [decimal](38,20) NOT NULL,
   [Lief_ nicht fakt_ Betrag] [decimal](38,20) NOT NULL,
   [Menge geliefert] [decimal](38,20) NOT NULL,
   [Menge fakturiert] [decimal](38,20) NOT NULL,
   [DB %] [decimal](38,20) NOT NULL,
   [Rech_ an Deb_-Nr_] [varchar](20) NOT NULL,
   [Geschäftsbuchungsgruppe] [varchar](20) NOT NULL,
   [Produktbuchungsgruppe] [varchar](20) NOT NULL,
   [MWSt Berechnungsart] [int] NOT NULL,
   [Art des Geschäftes] [varchar](10) NOT NULL,
   [Verkehrszweig] [varchar](10) NOT NULL,
   [Gehört zu Zeilennr_] [int] NOT NULL,
   [Einladehafen] [varchar](10) NOT NULL,
   [Ursprungsregion] [varchar](10) NOT NULL,
   [Verfahren] [varchar](10) NOT NULL,
   [Steuergebietscode] [varchar](20) NOT NULL,
   [Steuerpflichtig] [tinyint] NOT NULL,
   [Steuergruppencode] [varchar](10) NOT NULL,
   [MWSt Geschäftsbuchungsgruppe] [varchar](10) NOT NULL,
   [MWSt Produktbuchungsgruppe] [varchar](10) NOT NULL,
   [Währungscode] [varchar](10) NOT NULL,
   [Restauftragsbetrag (MW)] [decimal](38,20) NOT NULL,
   [Lief_ nicht fakt_ Betrag (MW)] [decimal](38,20) NOT NULL,
   [Reservierte Menge] [decimal](38,20) NOT NULL,
   [Reservieren] [int] NOT NULL,
   [MWSt Bemessungsgrundlage] [decimal](38,20) NOT NULL,
   [Einstandspreis] [decimal](38,20) NOT NULL,
   [Systembuchung] [tinyint] NOT NULL,
   [Ausstattungscode] [varchar](20) NOT NULL,
   [Buchnr_] [varchar](20) NOT NULL,
   [Variantencode] [varchar](10) NOT NULL,
   [Lagerfachcode] [varchar](10) NOT NULL,
   [Menge pro Einheit] [decimal](38,20) NOT NULL,
   [Geplant] [tinyint] NOT NULL,
   [Einheitencode] [varchar](10) NOT NULL,
   [Menge (Basis)] [decimal](38,20) NOT NULL,
   [Restauftragsmenge (Basis)] [decimal](38,20) NOT NULL,
   [Zu fakturieren (Basis)] [decimal](38,20) NOT NULL,
   [Zu liefern (Basis)] [decimal](38,20) NOT NULL,
   [Lief_ nicht fakt_ Menge(Basis)] [decimal](38,20) NOT NULL,
   [Menge geliefert (Basis)] [decimal](38,20) NOT NULL,
   [Menge fakturiert (Basis)] [decimal](38,20) NOT NULL,
   [Reservierte Menge (Basis)] [decimal](38,20) NOT NULL,
   [Text aus AW] [varchar](20) NOT NULL,
   [Menge in Greiferschein] [decimal](38,20) NOT NULL,
   [Bauteilgruppe] [varchar](10) NOT NULL,
   [Suchbegriff] [varchar](50) NOT NULL,
   [Monteurlohn] [decimal](38,20) NOT NULL,
   [Monteurlohn (Stunde)] [decimal](38,20) NOT NULL,
   [AW-Verrechnungsgrp_] [varchar](20) NOT NULL,
   [Trouble-Code GWA] [varchar](10) NOT NULL,
   [Monteur Nr_ 1] [varchar](20) NOT NULL,
   [Resource Nr_ 1] [varchar](20) NOT NULL,
   [OrderItem ID] [varchar](25) NOT NULL,
   [OrderItemType] [int] NOT NULL,
   [OrderItemRef] [int] NOT NULL,
   [Monteur Nr_ 2] [varchar](20) NOT NULL,
   [Resource Nr_ 2] [varchar](20) NOT NULL,
   [AW Mont_ 1] [decimal](38,20) NOT NULL,
   [AW Mont_ 2] [decimal](38,20) NOT NULL,
   [OPEL Mobilcard prüfen] [tinyint] NOT NULL,
   [Menge Lackmaterial] [decimal](38,20) NOT NULL,
   [Schaden Verurs__Repar_] [tinyint] NOT NULL,
   [Gar_-Fall-Nr_] [varchar](10) NOT NULL,
   [OrderItemOrigin] [varchar](10) NOT NULL,
   [SidRef] [varchar](30) NOT NULL,
   [Pos_ nicht senden] [tinyint] NOT NULL,
   [Sid] [varchar](30) NOT NULL,
   [Menge fakturiert (Stunde)] [decimal](38,20) NOT NULL,
   [Keinen Werkstattzuschlag] [tinyint] NOT NULL,
   [Jobnr_] [int] NOT NULL,
   [Vorgabezeit] [decimal](38,20) NOT NULL,
   [Menge pro Stunde] [decimal](38,20) NOT NULL,
   [Menge (Stunde)] [decimal](38,20) NOT NULL,
   [Restauftragsmenge (Stunde)] [decimal](38,20) NOT NULL,
   [Lief_ nicht fakt_Menge(Stunde)] [decimal](38,20) NOT NULL,
   [Menge geliefert (Stunde)] [decimal](38,20) NOT NULL,
   [Paketnr_] [varchar](20) NOT NULL,
   [Datenmarkencode] [varchar](10) NOT NULL,
   [Fahrzeugtermincode] [varchar](10) NOT NULL,
   [Nächster Termin am] [datetime] NOT NULL,
   [Nächster Termin ab Km] [int] NOT NULL,
   [Zusatzartikel] [int] NOT NULL,
   [Mengenmultiplikator] [decimal](38,20) NOT NULL,
   [Paketversionsnr_] [int] NOT NULL,
   [Kostenlos] [tinyint] NOT NULL,
   [Rabatte zulassen] [tinyint] NOT NULL,
   [AT-USt_ Bemessungsgrundlage] [decimal](38,20) NOT NULL,
   [AT-USt %] [decimal](38,20) NOT NULL,
   [AT-USt_ Betrag] [decimal](38,20) NOT NULL,
   [AT-MWSt_ %] [decimal](38,20) NOT NULL,
   [Verrechnungspreis] [decimal](38,20) NOT NULL,
   [Werkstattbuchungsgruppe] [varchar](10) NOT NULL,
   [Kostenstellencode Verkauf] [varchar](10) NOT NULL,
   [Festpreis] [decimal](38,20) NOT NULL,
   [Vorgabezeitart] [int] NOT NULL,
   [Kulanz] [tinyint] NOT NULL,
   [Zeilenverknüpfung Texte] [int] NOT NULL,
   [Zuschlagscode] [varchar](10) NOT NULL,
   [Mit Buchnummer buchen] [tinyint] NOT NULL,
   [Einsendepflicht] [int] NOT NULL,
   [In Auftrag unterdrücken] [tinyint] NOT NULL,
   [Einkaufslieferung] [varchar](20) NOT NULL,
   [Einkaufslieferzeile] [int] NOT NULL,
   [NummerSuchen] [tinyint] NOT NULL,
   [Dimension Änderung] [tinyint] NOT NULL,
   [Werterhöhende Massnahme] [tinyint] NOT NULL,
   [Lagerbuchungsgruppeart] [int] NOT NULL,
   [Lagerbuchungsgruppe] [varchar](10) NOT NULL,
   [Regalnummer] [varchar](20) NOT NULL,
   [Filialcode Verkauf] [varchar](10) NOT NULL,
   [Zeilenstatus] [int] NOT NULL,
   [Lfd_Nr für Verfügbarkeitsanz_] [int] NOT NULL,
   [AW-Zeitverteilung] [int] NOT NULL,
   [Zeile in Scanvorgang] [tinyint] NOT NULL,
   [Menge gescannt] [decimal](38,20) NOT NULL,
   [Dispounwirksam] [tinyint] NOT NULL,
   [Portion Std_ Time Order] [decimal](38,20) NOT NULL,
   [Portion Std_ Time Job] [decimal](38,20) NOT NULL,
   [Portion Inv_ Time Order] [decimal](38,20) NOT NULL,
   [Portion Inv_ Time Job] [decimal](38,20) NOT NULL,
   [Keine Rabatt Verbuchung] [tinyint] NOT NULL,
   [Artikelgruppencode] [varchar](10) NOT NULL,
   [Produktbuchungsgruppe Verkauf] [varchar](10) NOT NULL,
   [Process Type] [int] NOT NULL,
   [Lagerbestand] [decimal](38,20) NOT NULL,
   [Serv_ Contract Type] [varchar](20) NOT NULL,
   [Lost Sales Position] [tinyint] NOT NULL,
   [Client_DB] [varchar](50) NOT NULL
      CONSTRAINT [DF__Werkstatt__Clien__03AC0EEA] DEFAULT ('1')

   ,CONSTRAINT [Werkstattzeile$0] PRIMARY KEY CLUSTERED ([Belegart], [Belegnr_], [Zeilennr_], [Client_DB])
)


GO
