CREATE TABLE [import].[Service_Header] (
   [timestamp] [binary](8) NOT NULL,
   [Document Type] [int] NOT NULL,
   [No_] [varchar](20) NOT NULL,
   [Sell-to Customer No_] [varchar](20) NOT NULL,
   [Bill-to Customer No_] [varchar](20) NOT NULL,
   [Bill-to Name] [varchar](50) NOT NULL,
   [Bill-to Name 2] [varchar](50) NOT NULL,
   [Bill-to Address] [varchar](50) NOT NULL,
   [Bill-to Address 2] [varchar](50) NOT NULL,
   [Bill-to City] [varchar](50) NOT NULL,
   [Bill-to Contact] [varchar](50) NOT NULL,
   [Your Reference] [varchar](30) NOT NULL,
   [Order Date] [datetime] NOT NULL,
   [Posting Date] [datetime] NOT NULL,
   [Posting Description] [varchar](50) NOT NULL,
   [Payment Terms Code] [varchar](10) NOT NULL,
   [Due Date] [datetime] NOT NULL,
   [Payment Discount %] [decimal](38,20) NOT NULL,
   [Pmt_ Discount Date] [datetime] NOT NULL,
   [Shipment Method Code] [varchar](10) NOT NULL,
   [Location Code] [varchar](10) NOT NULL,
   [Department Code] [varchar](10) NOT NULL,
   [Make Code] [varchar](10) NOT NULL,
   [Customer Posting Group] [varchar](10) NOT NULL,
   [Currency Code] [varchar](10) NOT NULL,
   [Currency Factor] [decimal](38,20) NOT NULL,
   [Price Group Code] [varchar](10) NOT NULL,
   [Prices Including VAT] [tinyint] NOT NULL,
   [Allow Quantity Disc_] [tinyint] NOT NULL,
   [Cust__Item Disc_ Gr_] [varchar](10) NOT NULL,
   [Language Code] [varchar](10) NOT NULL,
   [Salesperson Code] [varchar](10) NOT NULL,
   [Order Class] [varchar](10) NOT NULL,
   [No_ Printed] [int] NOT NULL,
   [On Hold] [varchar](3) NOT NULL,
   [Bal_ Account No_] [varchar](20) NOT NULL,
   [Shipping No_] [varchar](20) NOT NULL,
   [Posting No_] [varchar](20) NOT NULL,
   [Last Shipping No_] [varchar](20) NOT NULL,
   [Last Posting No_] [varchar](20) NOT NULL,
   [VAT Registration No_] [varchar](20) NOT NULL,
   [Combine Shipments] [tinyint] NOT NULL,
   [Reason Code] [varchar](10) NOT NULL,
   [Gen_ Bus_ Posting Group] [varchar](10) NOT NULL,
   [EU 3-Party Trade] [tinyint] NOT NULL,
   [Transaction Type] [varchar](10) NOT NULL,
   [Transport Method] [varchar](10) NOT NULL,
   [VAT Country Code] [varchar](10) NOT NULL,
   [Sell-to Customer Name] [varchar](50) NOT NULL,
   [Sell-to Customer Name 2] [varchar](50) NOT NULL,
   [Sell-to Address] [varchar](50) NOT NULL,
   [Sell-to Address 2] [varchar](50) NOT NULL,
   [Sell-to City] [varchar](50) NOT NULL,
   [Sell-to Contact] [varchar](50) NOT NULL,
   [Bill-to Post Code] [varchar](20) NOT NULL,
   [Bill-to County] [varchar](30) NOT NULL,
   [Bill-to Country Code] [varchar](10) NOT NULL,
   [Sell-to Post Code] [varchar](20) NOT NULL,
   [Sell-to County] [varchar](30) NOT NULL,
   [Sell-to Country Code] [varchar](10) NOT NULL,
   [Ship-to Country Code] [varchar](10) NOT NULL,
   [Bal_ Account Type] [int] NOT NULL,
   [Exit Point] [varchar](10) NOT NULL,
   [Correction] [tinyint] NOT NULL,
   [Document Date] [datetime] NOT NULL,
   [External Document No_] [varchar](20) NOT NULL,
   [Area] [varchar](10) NOT NULL,
   [Transaction Specification] [varchar](10) NOT NULL,
   [Payment Method Code] [varchar](10) NOT NULL,
   [Shipping Agent Code] [varchar](10) NOT NULL,
   [Package Tracking No_] [varchar](30) NOT NULL,
   [No_ Series] [varchar](10) NOT NULL,
   [Posting No_ Series] [varchar](10) NOT NULL,
   [Shipping No_ Series] [varchar](10) NOT NULL,
   [Tax Area Code] [varchar](20) NOT NULL,
   [Tax Liable] [tinyint] NOT NULL,
   [VAT Bus_ Posting Group] [varchar](10) NOT NULL,
   [Reserve] [int] NOT NULL,
   [Applies-to ID] [varchar](20) NOT NULL,
   [VAT Base Discount %] [decimal](38,20) NOT NULL,
   [Option Code] [varchar](20) NOT NULL,
   [Service Posting Group] [varchar](30) NOT NULL,
   [Recognition Date] [datetime] NOT NULL,
   [WIP Posting Date] [datetime] NOT NULL,
   [VIN] [varchar](20) NOT NULL,
   [License No_] [varchar](30) NOT NULL,
   [Mileage] [decimal](38,20) NOT NULL,
   [Model Code] [varchar](20) NOT NULL,
   [Model No_] [varchar](20) NOT NULL,
   [Prod_ Year] [datetime] NOT NULL,
   [Model] [varchar](50) NOT NULL,
   [Type] [varchar](30) NOT NULL,
   [Initial Registration] [datetime] NOT NULL,
   [Gen_ Prod_ Posting Group] [varchar](10) NOT NULL,
   [Order Limit] [decimal](38,20) NOT NULL,
   [Time of Order] [datetime] NOT NULL,
   [Pickup Date] [datetime] NOT NULL,
   [Pickup Time] [datetime] NOT NULL,
   [Sell-to Home Phone No_] [varchar](50) NOT NULL,
   [Sell-to Phone No_] [varchar](50) NOT NULL,
   [Sell-to Mobile Phone No_] [varchar](50) NOT NULL,
   [Service Advisor No_] [varchar](20) NOT NULL,
   [Invoice Copies] [int] NOT NULL,
   [Completion Date] [datetime] NOT NULL,
   [Completion Time] [datetime] NOT NULL,
   [Sell-to Home Mobile Phone No_] [varchar](50) NOT NULL,
   [Engine Code] [varchar](10) NOT NULL,
   [Engine No_] [varchar](20) NOT NULL,
   [Customer Registration Date] [datetime] NOT NULL,
   [Engine Type Code] [varchar](20) NOT NULL,
   [No_ of Cylinders] [int] NOT NULL,
   [Cylinder Capacity (ccm)] [decimal](38,20) NOT NULL,
   [Power (kW)] [int] NOT NULL,
   [Power (hp)] [int] NOT NULL,
   [Transmission Type Code] [varchar](20) NOT NULL,
   [Tires] [varchar](15) NOT NULL,
   [No_ of Doors] [int] NOT NULL,
   [No_ of Axles] [int] NOT NULL,
   [4WD] [tinyint] NOT NULL,
   [Market Segment Code] [varchar](10) NOT NULL,
   [Vehicle Category Code] [varchar](10) NOT NULL,
   [Vehicle Type Code] [varchar](10) NOT NULL,
   [Emissions Test Category Code] [varchar](10) NOT NULL,
   [Labor Type] [varchar](30) NOT NULL,
   [Labor Charging Code] [varchar](10) NOT NULL,
   [Labor Price Group] [varchar](10) NOT NULL,
   [Ext_ Service Price Group] [varchar](10) NOT NULL,
   [WIP Posting] [tinyint] NOT NULL,
   [Book No_] [varchar](20) NOT NULL,
   [Branch Book No_] [varchar](20) NOT NULL,
   [Item Sales Price Group] [varchar](10) NOT NULL,
   [Show Discount] [tinyint] NOT NULL,
   [Sales Department Code] [varchar](10) NOT NULL,
   [Copy Header Text to Next Doc_] [tinyint] NOT NULL,
   [Copy Footer Text to Next Doc_] [tinyint] NOT NULL,
   [Add Service Surcharges] [tinyint] NOT NULL,
   [Item Sales Pr_ Grp_ Int_ Chrg_] [varchar](10) NOT NULL,
   [Int_ Charg_ Labor Price Group] [varchar](10) NOT NULL,
   [Ext Serv Int Charging Pr Grp] [varchar](10) NOT NULL,
   [G_L Acc_ Reduct_ % int_ Chrg_] [decimal](38,20) NOT NULL,
   [Post with Book No_] [tinyint] NOT NULL,
   [Color Class] [varchar](20) NOT NULL,
   [Upholstery Class] [varchar](20) NOT NULL,
   [Fixed Date] [tinyint] NOT NULL,
   [Fixed Instruction] [tinyint] NOT NULL,
   [Current Instruction Type] [int] NOT NULL,
   [Service Advisor No__Scheduling] [varchar](20) NOT NULL,
   [Branch Code] [varchar](10) NOT NULL,
   [Work Completed] [tinyint] NOT NULL,
   [Status Code] [varchar](20) NOT NULL,
   [Internal Document No_ Series] [varchar](10) NOT NULL,
   [Internal Document No_] [varchar](20) NOT NULL,
   [Service Advisor No__Pick-Up] [varchar](20) NOT NULL,
   [Use Inventory Buffer Quantity] [tinyint] NOT NULL,
   [Sales Branch Code] [varchar](10) NOT NULL,
   [Fabrication Code] [varchar](20) NOT NULL,
   [Purch_ Document Type] [int] NOT NULL,
   [Purch_ Document No_] [varchar](20) NOT NULL,
   [Purch_ Document Line No_] [int] NOT NULL,
   [Cockpit Cr_ Memo Version No_] [varchar](20) NOT NULL,
   [Disable for Requisition] [tinyint] NOT NULL,
   [Req_ Wksh_ Template Name] [varchar](20) NOT NULL,
   [Requisition Wksh_ Name] [varchar](20) NOT NULL,
   [Customer Contact Program] [tinyint] NOT NULL,
   [Mobile Service] [tinyint] NOT NULL,
   [Time Management activated] [tinyint] NOT NULL,
   [First Shipment Date] [datetime] NOT NULL,
   [Last Shipment Date] [datetime] NOT NULL,
   [Bulkcust_ Business] [tinyint] NOT NULL,
   [Bulk Customer No_] [varchar](30) NOT NULL,
   [Bulkcust_ Gen_ Bus_ Post_ Grp] [varchar](10) NOT NULL,
   [Bulkcust_ VAT Bus_ Post_ Group] [varchar](10) NOT NULL,
   [No_ of Bulk Customer] [varchar](10) NOT NULL,
   [Bulkcust_Veh_ Sales Price Grp] [varchar](10) NOT NULL,
   [Bulkcust_ Opt_ Sales Price Grp] [varchar](10) NOT NULL,
   [Bulkcust_ Item Sales Price Grp] [varchar](10) NOT NULL,
   [Guide Number] [varchar](10) NOT NULL,
   [Mileage when create Order] [decimal](38,20) NOT NULL,
   [Last Changed Timestamp] [datetime] NOT NULL,
   [Phone Number Documents] [int] NOT NULL,
   [Telephone Order] [varchar](50) NOT NULL,
   [Vehicle Status] [int] NOT NULL,
   [GAImportStatus] [int] NOT NULL,
   [GA-Import] [tinyint] NOT NULL,
   [User ID] [varchar](20) NOT NULL,
   [Shipment Date for Printing] [datetime] NOT NULL,
   [WIF Order No_] [varchar](10) NOT NULL,
   [WIF Order No_ Long] [varchar](20) NOT NULL,
   [WIF blocked] [tinyint] NOT NULL,
   [Last Stamp] [datetime] NOT NULL,
   [FBMOrderGUID] [uniqueidentifier] NOT NULL,
   [Restore date] [datetime] NOT NULL,
   [PPL AddressSalutationCode] [varchar](10) NOT NULL,
   [PPL Title Code] [varchar](10) NOT NULL,
   [PPL First Name] [varchar](50) NOT NULL,
   [PPL Last Name] [varchar](50) NOT NULL,
   [PPL Phone No_] [varchar](30) NOT NULL,
   [PPL E-Mail] [varchar](80) NOT NULL,
   [PPL Home E-Mail] [varchar](80) NOT NULL,
   [PPL DPP Policy] [tinyint] NOT NULL,
   [PPL Contact written Dealership] [tinyint] NOT NULL,
   [PPL Contact phone Dealership] [tinyint] NOT NULL,
   [PPL Contact Email Dealership] [tinyint] NOT NULL,
   [PPL Block Advertising] [tinyint] NOT NULL,
   [PPL Address] [varchar](50) NOT NULL,
   [PPL Post Code] [varchar](20) NOT NULL,
   [PPL City] [varchar](50) NOT NULL,
   [PPL Customer No_] [varchar](20) NOT NULL,
   [PPL Date DPP Policy Dealer] [datetime] NOT NULL,
   [PPL Print DPP Policy] [tinyint] NOT NULL,
   [PPL Contact written BMW] [tinyint] NOT NULL,
   [PPL Contact phone BMW] [tinyint] NOT NULL,
   [PPL Contact Email BMW] [tinyint] NOT NULL,
   [Email Order] [varchar](250) NOT NULL,
   [PPL Set Print DPP Policy Autom] [tinyint] NOT NULL,
   [Client_DB] [varchar](50) NOT NULL
       DEFAULT ('1')

   ,CONSTRAINT [Service Header$0] PRIMARY KEY CLUSTERED ([Document Type], [No_], [Client_DB])
)


GO
