CREATE TABLE VS4TAPInvoiceMBP(
	TIPMTIAPNo nvarchar(30) NOT NULL,
	TIPMLn int NOT NULL,
	TIPMType smallint NULL,
	TIPMGroupName nvarchar(30) NULL,
	TIPMJobCode nvarchar(30) NULL,
	TIPMTOExCode nvarchar(50) NULL,
	TIPMTPdtCode nvarchar(50) NULL,
	TIPMSerialNo nvarchar(30) NULL,
	TIPMCustom1 nvarchar(30) NULL,
	TIPMCustom2 nvarchar(150) NULL,
	TIPMCustom3 nvarchar(150) NULL,
	TIPMCustom4 nvarchar(150) NULL,
	TIPMCustom5 nvarchar(150) NULL,
	TIPMShippingMark nvarchar(255) NULL,
	TIPMProductCode nvarchar(50) NULL,
	TIPMFactoryCode nvarchar(50) NULL,
	TIPMProductName nvarchar(255) NULL,
	TIPMMinimumOrder float NULL,
	TIPMMaximumOrder float NULL,
	TIPMCost money NULL,
	TIPMPrice money NULL,
	TIPMPerQuantity float NULL,
	TIPMUnitFactor float NULL,
	TIPMQuantityText nvarchar(255) NULL,
	TIPMQuantity float NULL,
	TIPMAcceptError nvarchar(30) NULL,
	TIPMUnitCalc smallint NULL,
	TIPMQuantityCalc float NULL,
	TIPMQuantityStock float NULL,
	TIPMQuantityCost float NULL,
	TIPMTUntCode nvarchar(50) NULL,
	TIPMQuantity2 float NULL,
	TIPMTUntCode2 nvarchar(50) NULL,
	TIPMQuantity3 float NULL,
	TIPMTUntCode3 nvarchar(50) NULL,
	TIPMDutyAmount money NULL,
	TIPMDivideExpense money NULL,
	TIPMCostAmount money NULL,
	TIPMAmount float NULL,
	TIPMDiscountText nvarchar(30) NULL,
	TIPMDiscountTotal money NULL,
	TIPMNetAmount money NULL,
	TIPMAVGWeighting float NULL,
	TIPMDiscountBill money NULL,
	TIPMDeposit money NULL,
	TIPMTaxType smallint NULL,
	TIPMTaxBase money NULL,
	TIPMAmountVAT money NULL,
	TIPMWTaxType smallint NULL,
	TIPMWTAXBase money NULL,
	TIPMAmountWTAX money NULL,
	TIPMWTAXBase2 money NULL,
	TIPMAmountWTAX2 money NULL,
	TIPMExciseType smallint NULL,
	TIPMExciseBase money NULL,
	TIPMAmountExcise money NULL,
	TIPMGetNumber float NULL,
	TIPMFreeCode nvarchar(30) NULL,
	TIPMIsPremium smallint NULL,
	TIPMDescription nvarchar(255) NULL,
	TIPMGRNNo nvarchar(30) NULL,
	TIPMSourceNo nvarchar(30) NULL,
	TIPMSourceLn int NULL,
	TIPMSourceDate datetime NULL,
	TIPMTLctCode nvarchar(30) NULL,
	TIPMTotalCN float NULL,
	TIPMTotalCNArr float NULL,
	TIPMFlag1 smallint NULL,
	TIPMFlag2 smallint NULL,
	TIPMFlag3 datetime NULL
) ON [PRIMARY]
GO
ALTER TABLE VS4TAPInvoiceMBP ADD CONSTRAINT
	PK_VS4TAPInvoiceMBP PRIMARY KEY CLUSTERED 
	(
	TIPMTIAPNo,
	TIPMLn
	) ON [PRIMARY]

GO
