/****** Object:  Table [dbo].[Cost Centre]    Script Date: 20/12/2004 07:21:24 ******/
CREATE TABLE [dbo].[Cost Centre] (
	[CCCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CCDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CCLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Currency]    Script Date: 20/12/2004 07:21:24 ******/
CREATE TABLE [dbo].[Currency] (
	[CurNo] [int] NOT NULL ,
	[ScreenSymb] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PrinterSymb] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Name] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DailyRate] [float] NULL ,
	[CompanyRate] [float] NULL ,
	[TriEuro] [int] NULL ,
	[TriRates] [float] NULL ,
	[TriInvert] [bit] NOT NULL ,
	[TriFloat] [bit] NOT NULL ,
	[CurLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[CustSupp]    Script Date: 20/12/2004 07:21:24 ******/
CREATE TABLE [dbo].[CustSupp] (
	[CSAcCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[CSAltCode] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSName] [nvarchar] (65) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSLastBoughtSold] [smalldatetime] NULL ,
	[CSLastPaid] [smalldatetime] NULL ,
	[CSLastPaid2] [smalldatetime] NULL ,
	[CSFull Address] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSAddress1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSAddress2] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSAddress3] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSAddress4] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSAddress5] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSPostCode] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSPostCodeArea] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSAreaCode] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSTypeCode] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSInvoiceTo] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSStatmentTo] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSVATRegNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSDel Address1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSDel Address2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSDel Address3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSDel Address4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSDel Address5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSFull Del Address] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSContact] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSPhone] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSPhone2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSFax] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSOur Code with them] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSTradTerm1] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSTradTerm2] [nvarchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSOwnTerms] [bit] NOT NULL ,
	[CSPayment Terms] [int] NULL ,
	[CSCredit limit] [float] NULL ,
	[CSDiscount] [float] NULL ,
	[CSStatus] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSCost Centre] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSDepartment] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSBand] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSEECMember] [bit] NOT NULL ,
	[CSSalesGL] [int] NULL ,
	[CSCostOfSalesGL] [int] NULL ,
	[CSCtrlGL] [int] NULL ,
	[CSDefault Location] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSPay Type] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSBankSortCode] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSBankAccount] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSBankRef] [nvarchar] (28) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSLast Used] [smalldatetime] NULL ,
	[CSUser1] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser2] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser3] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser4] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser6] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser7] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser8] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser9] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSUser10] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSOrder Value] [float] NULL ,
	[CSDirect Debit Mode] [int] NULL ,
	[CSCC Start Date] [smalldatetime] NULL ,
	[CSCC End Date] [smalldatetime] NULL ,
	[CSCC Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSCC CardNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSCC Switch Ref] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSSettlement Days] [int] NULL ,
	[CSSettlement Discount] [int] NULL ,
	[CSForm No] [tinyint] NULL ,
	[CSe-mail Address] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSTagNo] [int] NULL ,
	[CSSSD Mode] [int] NULL ,
	[CSSSD Del Terms] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSBookOrdVal] [money] NULL ,
	[CSSalesP1] [money] NULL ,
	[CSSalesP2] [money] NULL ,
	[CSSalesP3] [money] NULL ,
	[CSSalesP4] [money] NULL ,
	[CSSalesP5] [money] NULL ,
	[CSSalesP6] [money] NULL ,
	[CSSalesP7] [money] NULL ,
	[CSSalesP8] [money] NULL ,
	[CSSalesP9] [money] NULL ,
	[CSSalesP10] [money] NULL ,
	[CSSalesP11] [money] NULL ,
	[CSSalesP12] [money] NULL ,
	[CSSalesP13] [money] NULL ,
	[CSSalesP14] [money] NULL ,
	[CSSalesP15] [money] NULL ,
	[CSSalesP16] [money] NULL ,
	[CSSalesP17] [money] NULL ,
	[CSSalesP18] [money] NULL ,
	[CSSalesP19] [money] NULL ,
	[CSSalesP20] [money] NULL ,
	[CSSalesP21] [money] NULL ,
	[CSSalesP22] [money] NULL ,
	[CSSalesP23] [money] NULL ,
	[CSSalesP24] [money] NULL ,
	[CSSalesP25] [money] NULL ,
	[CSSalesP26] [money] NULL ,
	[CSMarginP1] [float] NULL ,
	[CSMarginP2] [float] NULL ,
	[CSMarginP3] [float] NULL ,
	[CSMarginP4] [float] NULL ,
	[CSMarginP5] [float] NULL ,
	[CSMarginP6] [float] NULL ,
	[CSMarginP7] [float] NULL ,
	[CSMarginP8] [float] NULL ,
	[CSMarginP9] [float] NULL ,
	[CSMarginP10] [float] NULL ,
	[CSMarginP11] [float] NULL ,
	[CSMarginP12] [float] NULL ,
	[CSMarginP13] [float] NULL ,
	[CSMarginP14] [float] NULL ,
	[CSMarginP15] [float] NULL ,
	[CSMarginP16] [float] NULL ,
	[CSMarginP17] [float] NULL ,
	[CSMarginP18] [float] NULL ,
	[CSMarginP19] [float] NULL ,
	[CSMarginP20] [float] NULL ,
	[CSMarginP21] [float] NULL ,
	[CSMarginP22] [float] NULL ,
	[CSMarginP23] [float] NULL ,
	[CSMarginP24] [float] NULL ,
	[CSMarginP25] [float] NULL ,
	[CSMarginP26] [float] NULL ,
	[CSBudgetP1] [money] NULL ,
	[CSBudgetP2] [money] NULL ,
	[CSBudgetP3] [money] NULL ,
	[CSBudgetP4] [money] NULL ,
	[CSBudgetP5] [money] NULL ,
	[CSBudgetP6] [money] NULL ,
	[CSBudgetP7] [money] NULL ,
	[CSBudgetP8] [money] NULL ,
	[CSBudgetP9] [money] NULL ,
	[CSBudgetP10] [money] NULL ,
	[CSBudgetP11] [money] NULL ,
	[CSBudgetP12] [money] NULL ,
	[CSBudgetP13] [money] NULL ,
	[CSBudgetP14] [money] NULL ,
	[CSBudgetP15] [money] NULL ,
	[CSBudgetP16] [money] NULL ,
	[CSBudgetP17] [money] NULL ,
	[CSBudgetP18] [money] NULL ,
	[CSBudgetP19] [money] NULL ,
	[CSBudgetP20] [money] NULL ,
	[CSBudgetP21] [money] NULL ,
	[CSBudgetP22] [money] NULL ,
	[CSBudgetP23] [money] NULL ,
	[CSBudgetP24] [money] NULL ,
	[CSBudgetP25] [money] NULL ,
	[CSBudgetP26] [money] NULL ,
	[CSSalesY1] [money] NULL ,
	[CSSalesY2] [money] NULL ,
	[CSSalesY3] [money] NULL ,
	[CSSalesY4] [money] NULL ,
	[CSMarginY1] [float] NULL ,
	[CSMarginY2] [float] NULL ,
	[CSMarginY3] [float] NULL ,
	[CSMarginY4] [float] NULL ,
	[CSBalance] [money] NULL ,
	[CSCommitted] [money] NULL ,
	[CSSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CSBudGetY1] [money] NULL ,
	[CSBudGetY2] [money] NULL ,
	[CSBudGetY3] [money] NULL ,
	[CSBudGetY4] [money] NULL ,
	[CSLastUpdate] [smalldatetime] NULL ,
	[CSFirstSoldBought] [smalldatetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Department]    Script Date: 20/12/2004 07:21:25 ******/
CREATE TABLE [dbo].[Department] (
	[DPCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[DPDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DPLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[GL]    Script Date: 20/12/2004 07:21:25 ******/
CREATE TABLE [dbo].[GL] (
	[GLCode] [int] NOT NULL ,
	[GLDescription] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GLNomType2] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GLAltCode] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GLCurrency] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GLNomType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GLHeading1] [int] NULL ,
	[GLHeading2] [int] NULL ,
	[GLHeading3] [int] NULL ,
	[GLHeading4] [int] NULL ,
	[GLHeading5] [int] NULL ,
	[GLHeading6] [int] NULL ,
	[GLHeading7] [int] NULL ,
	[GLHeading8] [int] NULL ,
	[GLHeading9] [int] NULL ,
	[GLHeading10] [int] NULL ,
	[GLLevel] [tinyint] NULL ,
	[GLSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[GLLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Job]    Script Date: 20/12/2004 07:21:25 ******/
CREATE TABLE [dbo].[Job] (
	[JBJobCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JBJobDesc] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBJobFolio] [int] NULL ,
	[JBCustCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBJobType] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBJobStatus] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBJobCat] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBJobAltCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBContact] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBJobManager] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBChargeType] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBQuotePrice] [money] NULL ,
	[JBCurrency] [tinyint] NULL ,
	[JBCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBStartDate] [smalldatetime] NULL ,
	[JBEndDate] [smalldatetime] NULL ,
	[JBRevDate] [smalldatetime] NULL ,
	[JBSORRef] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBVATCode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef1] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef2] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef3] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef4] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef6] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef7] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef8] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef9] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBUserDef10] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBParent] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBHeading1] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBHeading2] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBHeading3] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBHeading4] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBHeading5] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBHeading6] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JBLevel] [tinyint] NULL ,
	[JBTotalActual] [float] NULL ,
	[JBTotalBudget] [float] NULL ,
	[JBTotalRevisedBudget] [float] NULL ,
	[JBTotalActualCom] [float] NULL ,
	[JBTotalBudgetQty] [float] NULL ,
	[JBTotalRevBudgetQty] [float] NULL ,
	[JBRevenue] [float] NULL ,
	[JBLabour] [float] NULL ,
	[JBDisbursements] [float] NULL ,
	[JBNon recover Expenses] [float] NULL ,
	[JBStock issues] [float] NULL ,
	[JBOverheads] [float] NULL ,
	[JBProfit] [float] NULL ,
	[JBReceipts] [float] NULL ,
	[JBWIP] [float] NULL ,
	[JBRetension S/L] [float] NULL ,
	[JBRetension P/L] [float] NULL ,
	[JBLastUpdate] [smalldatetime] NULL ,
	[JBLastTimesheet] [smalldatetime] NULL ,
	[JBLastSales] [smalldatetime] NULL ,
	[JBLastPurchase] [smalldatetime] NULL ,
	[JBFirstTimesheet] [smalldatetime] NULL ,
	[JBFirstSales] [smalldatetime] NULL ,
	[JBFirstPurchase] [smalldatetime] NULL ,
	[JBLastTrans] [smalldatetime] NULL ,
	[JBGP] [float] NULL ,
	[JBFirstTrans] [smalldatetime] NULL ,
	[JBBudgetRevenue] [float] NULL ,
	[JBBudgetLabour] [float] NULL ,
	[JBBudgetDisbursements] [float] NULL ,
	[JBBudgetNon recover Expenses] [float] NULL ,
	[JBBudgetStock issues] [float] NULL ,
	[JBBudgetOverheads] [float] NULL ,
	[JBBudgetProfit] [float] NULL ,
	[JBBudgetReceipts] [float] NULL ,
	[JBBudgetWIP] [float] NULL ,
	[JBBudgetRetension S/L] [float] NULL ,
	[JBBudgetRetension P/L] [float] NULL ,
	[JBRevBudgetRevenue] [float] NULL ,
	[JBRevBudgetLabour] [float] NULL ,
	[JBRevBudgetDisbursements] [float] NULL ,
	[JBRevBudgetNon recover Expenses] [float] NULL ,
	[JBRevBudgetStock issues] [float] NULL ,
	[JBRevBudgetOverheads] [float] NULL ,
	[JBRevBudgetProfit] [float] NULL ,
	[JBRevBudgetReceipts] [float] NULL ,
	[JBRevBudgetWIP] [float] NULL ,
	[JBRevBudgetRetension S/L] [float] NULL ,
	[JBRevBudgetRetension P/L] [float] NULL ,
	[JBQtyBudgetRevenue] [float] NULL ,
	[JBQtyBudgetLabour] [float] NULL ,
	[JBQtyBudgetDisbursements] [float] NULL ,
	[JBQtyBudgetNon recover Expenses] [float] NULL ,
	[JBQtyBudgetStock issues] [float] NULL ,
	[JBQtyBudgetOverheads] [float] NULL ,
	[JBQtyBudgetProfit] [float] NULL ,
	[JBQtyBudgetReceipts] [float] NULL ,
	[JBQtyBudgetWIP] [float] NULL ,
	[JBQtyBudgetRetension S/L] [float] NULL ,
	[JBQtyBudgetRetension P/L] [float] NULL ,
	[JBQtyRevBudgetRevenue] [float] NULL ,
	[JBQtyRevBudgetLabour] [float] NULL ,
	[JBQtyRevBudgetDisbursements] [float] NULL ,
	[JBQtyRevBudgetNon recover Expenses] [float] NULL ,
	[JBQtyRevBudgetStock issues] [float] NULL ,
	[JBQtyRevBudgetOverheads] [float] NULL ,
	[JBQtyRevBudgetProfit] [float] NULL ,
	[JBQtyRevBudgetReceipts] [float] NULL ,
	[JBQtyRevBudgetWIP] [float] NULL ,
	[JBQtyRevBudgetRetension S/L] [float] NULL ,
	[JBQtyRevBudgetRetension P/L] [float] NULL 
) ON [PRIMARY] 
GO

/****** Object:  Table [dbo].[JobAnalysis]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[JobAnalysis] (
	[JAAnalCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JAAnalDesc] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JAAnalType] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JAAnalCategory] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JAWIPNomCode] [int] NULL ,
	[JAPLNomCode] [int] NULL ,
	[JALineType] [nvarchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JASystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JAAnalOrder] [tinyint] NULL ,
	[JACategoryHistFolio] [int] NULL ,
	[JALastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[JobAnalysisTotals]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[JobAnalysisTotals] (
	[JTID] [int] IDENTITY (1, 1) NOT NULL ,
	[JTJobCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JTAnalCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JTBudget] [float] NULL ,
	[JTRevBudget] [float] NULL ,
	[JTActual] [float] NULL ,
	[JTActualCom] [float] NULL ,
	[JTBudgetQty] [float] NULL ,
	[JTRevBudgetQty] [float] NULL ,
	[JTHistFolio] [int] NULL ,
	[JTSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JTLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[JobEmployee]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[JobEmployee] (
	[JEEmpCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JESupplier] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEEmpName] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEAddr1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEAddr2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEAddr3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEAddr4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEAddr5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEPhone] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEFax] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEMobile] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEEmpType] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEPayNo] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JECertNo] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JECertExpiry] [datetime] NULL ,
	[JEUserDef1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEUserDef2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEUserDef3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEUserDef4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JECC] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JEDep] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JESystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JELastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[JobRate]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[JobRate] (
	[JRRateCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[JREmpCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JRDescription] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JRAnalCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JRCostCur] [tinyint] NULL ,
	[JRChargeCur] [tinyint] NULL ,
	[JRCost] [money] NULL ,
	[JRChargeRate] [money] NULL ,
	[JRPayRollCode] [int] NULL ,
	[JRChargeCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JRCostCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JRSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[JRLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Location]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[Location] (
	[LOCode] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[LODescription] [nvarchar] (45) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LOLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Notes]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[Notes] (
	[NOID] [int] IDENTITY (1, 1) NOT NULL ,
	[NOCode] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NONote] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NOType] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NOLength] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[OutStandingTrans]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[OutStandingTrans] (
	[OTID] [int] IDENTITY (1, 1) NOT NULL ,
	[OTAcCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OTOurRef] [nvarchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OTTransDate] [smalldatetime] NULL ,
	[OTDueDate] [smalldatetime] NULL ,
	[OTOutStandingAmt] [money] NULL ,
	[OTLineClass] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OTSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OTYourRef] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OTAltRef] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OTLastUpdate] [smalldatetime] NULL ,
	[OTTriggerDate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[OutstandingOrders]    Script Date: 20/12/2004 07:21:26 ******/
CREATE TABLE [dbo].[OutstandingOrders] (
	[ORID] [int] IDENTITY (1, 1) NOT NULL ,
	[ORAcCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[OROurRef] [nvarchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ORTransDate] [smalldatetime] NULL ,
	[ORDueDate] [smalldatetime] NULL ,
	[OROutStandingAmt] [money] NULL ,
	[ORLineClass] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ORSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ORYourRef] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ORAltRef] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ORLastUpdate] [smalldatetime] NULL ,
	[ORTriggerDate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Periods Description]    Script Date: 20/12/2004 07:21:27 ******/
CREATE TABLE [dbo].[Periods Description] (
	[Period] [int] NOT NULL ,
	[Description] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Stock]    Script Date: 20/12/2004 07:21:27 ******/
CREATE TABLE [dbo].[Stock] (
	[STStockFolio] [int] NOT NULL ,
	[STCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[STType] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STAltCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STValutaion Method] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STFull Description] [nvarchar] (330) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STLastBought] [smalldatetime] NULL ,
	[STLastSold] [smalldatetime] NULL ,
	[STDescription1] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STDescription2] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STDescription3] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STDescription4] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STDescription5] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STDescription6] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STQtyInStock] [float] NULL ,
	[STQtyOnOrder] [float] NULL ,
	[STQtyAlloc] [float] NULL ,
	[STQtyPicked] [float] NULL ,
	[STQtyMin] [float] NULL ,
	[STQtyMax] [float] NULL ,
	[STQtyFree] [int] NULL ,
	[STLastUsed] [smalldatetime] NULL ,
	[STMain Supplier] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STCostOfSaleGL] [int] NULL ,
	[STSalesGL] [int] NULL ,
	[STPLGL] [int] NULL ,
	[STBalGL] [int] NULL ,
	[STWIPGL] [int] NULL ,
	[STBand Curreny A] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Curreny B] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Curreny C] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Curreny D] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Curreny E] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Curreny F] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Curreny G] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Curreny H] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand Price A] [float] NULL ,
	[STBand Price B] [float] NULL ,
	[STBand Price C] [float] NULL ,
	[STBand Price D] [float] NULL ,
	[STBand Price E] [float] NULL ,
	[STBand Price F] [float] NULL ,
	[STBand Price G] [float] NULL ,
	[STBand Price H] [float] NULL ,
	[STBand CurrenyNo A] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand CurrenyNo B] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand CurrenyNo C] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand CurrenyNo D] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand CurrenyNo E] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand CurrenyNo F] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand CurrenyNo G] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBand CurrenyNo H] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUnit Stock Desc] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUnit Selling Desc] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUnit Purchase Desc] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STShow Qty as Packs] [bit] NOT NULL ,
	[STCost Price] [money] NULL ,
	[STCost Price Currency] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STSelling Qty Multiplier] [float] NULL ,
	[STPurchase Qty Multiplier] [float] NULL ,
	[STVAT Code] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STCost Centre] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STDepartment] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STBin Location] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STReOrder Price] [money] NULL ,
	[STReOrder Currency] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STReOrder Date] [smalldatetime] NULL ,
	[STReorderCostCentre] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STReorderDepartment] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STReorderQty] [float] NULL ,
	[STBar Code] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STLocation] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser1] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser2] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser6] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser7] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser8] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser9] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUser10] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STInclude on Web] [bit] NOT NULL ,
	[STWeb Category] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STWeb Image File] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STHeading1] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STHeading2] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STHeading3] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STHeading4] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STHeading5] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STHeading6] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STLevel] [tinyint] NULL ,
	[STParent] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STJobAnal] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STUseForEbus] [bit] NOT NULL ,
	[STBelowMinLevel] [bit] NOT NULL ,
	[STSSDCountry] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STSSDCommodity Code] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STSSDSale Weight] [float] NULL ,
	[STSSDPurchase Weight] [float] NULL ,
	[STSSDUnitDesc] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STSSDStockUnits] [float] NULL ,
	[STSSDDespatchUplift] [float] NULL ,
	[STCover] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STDefaultLineType] [tinyint] NULL ,
	[STCoverMaxPeriods] [float] NULL ,
	[STCoverMaxPeriodUnits] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STCoverMinPeriods] [float] NULL ,
	[STCoverMinPeriodUnits] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STCoverPeriods] [float] NULL ,
	[STCoverPeriodUnits] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[STCoverQtySold] [float] NULL ,
	[STCoverUse] [bit] NOT NULL ,
	[STLastUpdate] [smalldatetime] NULL ,
	[STFirstBought] [smalldatetime] NULL ,
	[STFirstSold] [smalldatetime] NULL ,
	[STSalesP1] [money] NULL ,
	[STSalesP2] [money] NULL ,
	[STSalesP3] [money] NULL ,
	[STSalesP4] [money] NULL ,
	[STSalesP5] [money] NULL ,
	[STSalesP6] [money] NULL ,
	[STSalesP7] [money] NULL ,
	[STSalesP8] [money] NULL ,
	[STSalesP9] [money] NULL ,
	[STSalesP10] [money] NULL ,
	[STSalesP11] [money] NULL ,
	[STSalesP12] [money] NULL ,
	[STSalesP13] [money] NULL ,
	[STSalesP14] [money] NULL ,
	[STSalesP15] [money] NULL ,
	[STSalesP16] [money] NULL ,
	[STSalesP17] [money] NULL ,
	[STSalesP18] [money] NULL ,
	[STSalesP19] [money] NULL ,
	[STSalesP20] [money] NULL ,
	[STSalesP21] [money] NULL ,
	[STSalesP22] [money] NULL ,
	[STSalesP23] [money] NULL ,
	[STSalesP24] [money] NULL ,
	[STSalesP25] [money] NULL ,
	[STSalesP26] [money] NULL ,
	[STCostsP1] [money] NULL ,
	[STCostsP2] [money] NULL ,
	[STCostsP3] [money] NULL ,
	[STCostsP4] [money] NULL ,
	[STCostsP5] [money] NULL ,
	[STCostsP6] [money] NULL ,
	[STCostsP7] [money] NULL ,
	[STCostsP8] [money] NULL ,
	[STCostsP9] [money] NULL ,
	[STCostsP10] [money] NULL ,
	[STCostsP11] [money] NULL ,
	[STCostsP12] [money] NULL ,
	[STCostsP13] [money] NULL ,
	[STCostsP14] [money] NULL ,
	[STCostsP15] [money] NULL ,
	[STCostsP16] [money] NULL ,
	[STCostsP17] [money] NULL ,
	[STCostsP18] [money] NULL ,
	[STCostsP19] [money] NULL ,
	[STCostsP20] [money] NULL ,
	[STCostsP21] [money] NULL ,
	[STCostsP22] [money] NULL ,
	[STCostsP23] [money] NULL ,
	[STCostsP24] [money] NULL ,
	[STCostsP25] [money] NULL ,
	[STCostsP26] [money] NULL ,
	[STQtyP1] [float] NULL ,
	[STQtyP2] [float] NULL ,
	[STQtyP3] [float] NULL ,
	[STQtyP4] [float] NULL ,
	[STQtyP5] [float] NULL ,
	[STQtyP6] [float] NULL ,
	[STQtyP7] [float] NULL ,
	[STQtyP8] [float] NULL ,
	[STQtyP9] [float] NULL ,
	[STQtyP10] [float] NULL ,
	[STQtyP11] [float] NULL ,
	[STQtyP12] [float] NULL ,
	[STQtyP13] [float] NULL ,
	[STQtyP14] [float] NULL ,
	[STQtyP15] [float] NULL ,
	[STQtyP16] [float] NULL ,
	[STQtyP17] [float] NULL ,
	[STQtyP18] [float] NULL ,
	[STQtyP19] [float] NULL ,
	[STQtyP20] [float] NULL ,
	[STQtyP21] [float] NULL ,
	[STQtyP22] [float] NULL ,
	[STQtyP23] [float] NULL ,
	[STQtyP24] [float] NULL ,
	[STQtyP25] [float] NULL ,
	[STQtyP26] [float] NULL ,
	[STSalesY1] [money] NULL ,
	[STSalesY2] [money] NULL ,
	[STSalesY3] [money] NULL ,
	[STSalesY4] [money] NULL ,
	[STCostsY1] [money] NULL ,
	[STCostsY2] [money] NULL ,
	[STCostsY3] [money] NULL ,
	[STCostsY4] [money] NULL ,
	[STQtyY1] [float] NULL ,
	[STQtyY2] [float] NULL ,
	[STQtyY3] [float] NULL ,
	[STQtyY4] [float] NULL ,
	[STBudgetP1] [money] NULL ,
	[STBudgetP2] [money] NULL ,
	[STBudgetP3] [money] NULL ,
	[STBudgetP4] [money] NULL ,
	[STBudgetP5] [money] NULL ,
	[STBudgetP6] [money] NULL ,
	[STBudgetP7] [money] NULL ,
	[STBudgetP8] [money] NULL ,
	[STBudgetP9] [money] NULL ,
	[STBudgetP10] [money] NULL ,
	[STBudgetP11] [money] NULL ,
	[STBudgetP12] [money] NULL ,
	[STBudgetP13] [money] NULL ,
	[STBudgetP14] [money] NULL ,
	[STBudgetP15] [money] NULL ,
	[STBudgetP16] [money] NULL ,
	[STBudgetP17] [money] NULL ,
	[STBudgetP18] [money] NULL ,
	[STBudgetP19] [money] NULL ,
	[STBudgetP20] [money] NULL ,
	[STBudgetP21] [money] NULL ,
	[STBudgetP22] [money] NULL ,
	[STBudgetP23] [money] NULL ,
	[STBudgetP24] [money] NULL ,
	[STBudgetP25] [money] NULL ,
	[STBudgetP26] [money] NULL ,
	[STBudgetY1] [float] NULL ,
	[STBudgetY2] [float] NULL ,
	[STBudgetY3] [float] NULL ,
	[STBudgetY4] [float] NULL ,
	[STWORQtyAlloc] [float] NULL ,
	[STWORQtyPicked] [float] NULL ,
	[STWORQtyIssued] [float] NULL ,
	[STWOPMinEconBuild] [float] NULL ,
	[STWOPAssemblyDays] [int] NULL ,
	[STWOPAssemblyMins] [int] NULL ,
	[STWOPAssemblyHours] [int] NULL ,
	[STBOMProductionTime] [int] NULL ,
	[STWOPAutoCalcTime] [bit] NOT NULL ,
	[STWOPRoLeadTime] [int] NULL ,
	[STWOPIssuedWIPGL] [int] NULL ,
	[STUsesBins] [bit] NOT NULL ,
	[STShowKitOnSales] [bit] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[System Audit]    Script Date: 20/12/2004 07:21:28 ******/
CREATE TABLE [dbo].[System Audit] (
	[ID] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Number] [int] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[SystemVars]    Script Date: 20/12/2004 07:21:28 ******/
CREATE TABLE [dbo].[SystemVars] (
	[ID] [int] NOT NULL ,
	[Last Updated] [smalldatetime] NULL ,
	[Year] [int] NULL ,
	[ExchYear] [int] NULL ,
	[OLE Code] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CompanyName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Period] [int] NULL ,
	[PeriodsInYear] [int] NULL ,
	[YearStartDate] [smalldatetime] NULL ,
	[ReReadStockHeadings] [bit] NOT NULL ,
	[ReReadJobHeadings] [bit] NOT NULL ,
	[ReReadJobBudgets] [bit] NOT NULL ,
	[QtyDP] [int] NULL ,
	[SalesCurDP] [int] NULL ,
	[CostCurDP] [int] NULL ,
	[NoErrors] [int] NULL ,
	[ErrorLog] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[LastupdateLog] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ExchFilePath] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DataFilePath] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ProgPath] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FileVersion] [int] NULL ,
	[ProgVersion] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[RunNO] [int] NULL ,
	[Flag1] [bit] NOT NULL ,
	[Flag2] [bit] NOT NULL ,
	[Flag3] [bit] NOT NULL ,
	[Flag4] [bit] NOT NULL ,
	[Flag5] [bit] NOT NULL ,
	[Flag6] [bit] NOT NULL ,
	[Flag7] [bit] NOT NULL ,
	[Flag8] [bit] NOT NULL ,
	[Flag9] [bit] NOT NULL ,
	[Flag10] [bit] NOT NULL ,
	[Flag11] [bit] NOT NULL ,
	[Flag12] [bit] NOT NULL ,
	[Flag13] [bit] NOT NULL ,
	[Flag14] [bit] NOT NULL ,
	[Flag15] [bit] NOT NULL ,
	[Flag16] [bit] NOT NULL ,
	[Flag17] [bit] NOT NULL ,
	[Flag18] [bit] NOT NULL ,
	[Flag19] [bit] NOT NULL ,
	[Flag20] [bit] NOT NULL ,
	[Var1] [int] NULL ,
	[Var2] [int] NULL ,
	[Var3] [int] NULL ,
	[Var4] [int] NULL ,
	[Var5] [int] NULL ,
	[Var6] [int] NULL ,
	[Var7] [int] NULL ,
	[Var8] [int] NULL ,
	[Var9] [int] NULL ,
	[Var10] [int] NULL ,
	[String1] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String2] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String3] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String4] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String5] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String6] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String7] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String8] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String9] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[String10] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[TransHeader]    Script Date: 20/12/2004 07:21:28 ******/
CREATE TABLE [dbo].[TransHeader] (
	[THFolio] [int] NOT NULL ,
	[THRunNo] [int] NULL ,
	[THOurRef] [nvarchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THPosted] [bit] NOT NULL ,
	[THDocType] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THSubType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THTransDate] [smalldatetime] NULL ,
	[THDueDate] [smalldatetime] NULL ,
	[THAcCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THAcCodeIncDel] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THEmployeeCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THYourRef] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THAltRef] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser6] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser7] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser8] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser9] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THUser10] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THTotalCostInBase] [float] NULL ,
	[THTotalCostInCur] [float] NULL ,
	[THTotalGrossInBase] [float] NULL ,
	[THTotalGrossInCur] [float] NULL ,
	[THTotalNetInBase] [float] NULL ,
	[THTotalNetInCur] [float] NULL ,
	[THTotalVAT] [float] NULL ,
	[THTotalWeight] [float] NULL ,
	[THControlGL] [int] NULL ,
	[THCurrency] [tinyint] NULL ,
	[THCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THCompRate] [float] NULL ,
	[THDailyRate] [float] NULL ,
	[THManualVAT] [bit] NOT NULL ,
	[THNoLabels] [int] NULL ,
	[THSettlementPercent] [float] NULL ,
	[THSettlementDays] [int] NULL ,
	[THSettleDiscAmount] [float] NULL ,
	[THTotalSettledInBase] [float] NULL ,
	[THTotalLineDiscount] [float] NULL ,
	[THYearPeriod] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THYear] [int] NULL ,
	[THPeriod] [tinyint] NULL ,
	[THSigned] [float] NULL ,
	[THDelAddress] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THOperator] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THSSDTransportMode] [int] NULL ,
	[THSSDTransportNature] [int] NULL ,
	[THSSDDelTerms] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THPaymentInBase] [float] NULL ,
	[THPaymentInCur] [float] NULL ,
	[THNoLines] [int] NULL ,
	[THStatus] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THPostedDate] [smalldatetime] NULL ,
	[THLastUpdate] [smalldatetime] NULL ,
	[THVATDate] [smalldatetime] NULL ,
	[THDelAdd1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THDelAdd2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THDelAdd3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THDelAdd4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THDelAdd5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[THTagged] [int] NULL ,
	[THGP] [float] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[CustSupp Discount]    Script Date: 20/12/2004 07:21:29 ******/
CREATE TABLE [dbo].[CustSupp Discount] (
	[DSID] [int] IDENTITY (1, 1) NOT NULL ,
	[DSAcCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DSStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DSBand] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DSType] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DSSpecial Price] [money] NULL ,
	[DSSpecial Price Currency] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DSDiscAmount] [money] NULL ,
	[DSPercent] [float] NULL ,
	[DSSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DSLastUpdate] [smalldatetime] NULL ,
	[DSApplyDate] [smalldatetime] NULL ,
	[DSNewValue] [money] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Stock Alt Codes]    Script Date: 20/12/2004 07:21:29 ******/
CREATE TABLE [dbo].[Stock Alt Codes] (
	[SAID] [int] IDENTITY (1, 1) NOT NULL ,
	[SAStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SAAltCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SAAltDesc] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SASuppCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SAROCurr] [int] NULL ,
	[SAROPrice] [float] NULL ,
	[SAROCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SAUseROPrice] [bit] NOT NULL ,
	[SALastUsed] [smalldatetime] NULL ,
	[SASystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SALastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Stock BOM]    Script Date: 20/12/2004 07:21:29 ******/
CREATE TABLE [dbo].[Stock BOM] (
	[SBID] [int] IDENTITY (1, 1) NOT NULL ,
	[SBParStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBOrder] [int] NULL ,
	[SBStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBCost] [float] NULL ,
	[SBQty] [float] NULL ,
	[SBCostCur] [tinyint] NULL ,
	[SBCostCurSYMB] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBHeading1] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBHeading2] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBHeading3] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBHeading4] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBHeading5] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBHeading6] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBFlag] [bit] NOT NULL ,
	[SBDescription] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBLevel] [tinyint] NULL ,
	[SBAnother BOM] [bit] NOT NULL ,
	[SBSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SBLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Stock Discount]    Script Date: 20/12/2004 07:21:29 ******/
CREATE TABLE [dbo].[Stock Discount] (
	[SDID] [int] IDENTITY (1, 1) NOT NULL ,
	[SDStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SDFrom] [int] NULL ,
	[SDTo] [int] NULL ,
	[SDType] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SDBand] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SDSpecial Price] [money] NULL ,
	[SDSpecial Price Currency] [nvarchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SDDiscAmount] [money] NULL ,
	[SDPercent] [float] NULL ,
	[SDSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SDLastUpdate] [smalldatetime] NULL ,
	[SDApplyDate] [smalldatetime] NULL ,
	[SDNewValue] [money] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Stock Location]    Script Date: 20/12/2004 07:21:29 ******/
CREATE TABLE [dbo].[Stock Location] (
	[SLID] [int] IDENTITY (1, 1) NOT NULL ,
	[SLStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SLLocation] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SLQtyInStock] [float] NULL ,
	[SLQtyOnOrder] [float] NULL ,
	[SLQtyAlloc] [float] NULL ,
	[SLQtyPicked] [float] NULL ,
	[SLQtyMin] [float] NULL ,
	[SLQtyMax] [float] NULL ,
	[SLQtyFreeze] [float] NULL ,
	[SLQtyFree] [int] NULL ,
	[SLReOrderQty] [float] NULL ,
	[SLReOrderDate] [smalldatetime] NULL ,
	[SLLastUsed] [smalldatetime] NULL ,
	[SLMain Supplier] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SLCostOfSaleGL] [int] NULL ,
	[SLSalesGL] [int] NULL ,
	[SLPLGL] [int] NULL ,
	[SLBalGL] [int] NULL ,
	[SLWIPGL] [int] NULL ,
	[SLLastBought] [smalldatetime] NULL ,
	[SLLastSold] [smalldatetime] NULL ,
	[SLSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SLLastUpdate] [smalldatetime] NULL ,
	[SLFirstBought] [smalldatetime] NULL ,
	[SLFirstSold] [smalldatetime] NULL ,
	[SLSalesP1] [money] NULL ,
	[SLSalesP2] [money] NULL ,
	[SLSalesP3] [money] NULL ,
	[SLSalesP4] [money] NULL ,
	[SLSalesP5] [money] NULL ,
	[SLSalesP6] [money] NULL ,
	[SLSalesP7] [money] NULL ,
	[SLSalesP8] [money] NULL ,
	[SLSalesP9] [money] NULL ,
	[SLSalesP10] [money] NULL ,
	[SLSalesP11] [money] NULL ,
	[SLSalesP12] [money] NULL ,
	[SLSalesP13] [money] NULL ,
	[SLSalesP14] [money] NULL ,
	[SLSalesP15] [money] NULL ,
	[SLSalesP16] [money] NULL ,
	[SLSalesP17] [money] NULL ,
	[SLSalesP18] [money] NULL ,
	[SLSalesP19] [money] NULL ,
	[SLSalesP20] [money] NULL ,
	[SLSalesP21] [money] NULL ,
	[SLSalesP22] [money] NULL ,
	[SLSalesP23] [money] NULL ,
	[SLSalesP24] [money] NULL ,
	[SLSalesP25] [money] NULL ,
	[SLSalesP26] [money] NULL ,
	[SLCostsP1] [money] NULL ,
	[SLCostsP2] [money] NULL ,
	[SLCostsP3] [money] NULL ,
	[SLCostsP4] [money] NULL ,
	[SLCostsP5] [money] NULL ,
	[SLCostsP6] [money] NULL ,
	[SLCostsP7] [money] NULL ,
	[SLCostsP8] [money] NULL ,
	[SLCostsP9] [money] NULL ,
	[SLCostsP10] [money] NULL ,
	[SLCostsP11] [money] NULL ,
	[SLCostsP12] [money] NULL ,
	[SLCostsP13] [money] NULL ,
	[SLCostsP14] [money] NULL ,
	[SLCostsP15] [money] NULL ,
	[SLCostsP16] [money] NULL ,
	[SLCostsP17] [money] NULL ,
	[SLCostsP18] [money] NULL ,
	[SLCostsP19] [money] NULL ,
	[SLCostsP20] [money] NULL ,
	[SLCostsP21] [money] NULL ,
	[SLCostsP22] [money] NULL ,
	[SLCostsP23] [money] NULL ,
	[SLCostsP24] [money] NULL ,
	[SLCostsP25] [money] NULL ,
	[SLCostsP26] [money] NULL ,
	[SLQtyP1] [float] NULL ,
	[SLQtyP2] [float] NULL ,
	[SLQtyP3] [float] NULL ,
	[SLQtyP4] [float] NULL ,
	[SLQtyP5] [float] NULL ,
	[SLQtyP6] [float] NULL ,
	[SLQtyP7] [float] NULL ,
	[SLQtyP8] [float] NULL ,
	[SLQtyP9] [float] NULL ,
	[SLQtyP10] [float] NULL ,
	[SLQtyP11] [float] NULL ,
	[SLQtyP12] [float] NULL ,
	[SLQtyP13] [float] NULL ,
	[SLQtyP14] [float] NULL ,
	[SLQtyP15] [float] NULL ,
	[SLQtyP16] [float] NULL ,
	[SLQtyP17] [float] NULL ,
	[SLQtyP18] [float] NULL ,
	[SLQtyP19] [float] NULL ,
	[SLQtyP20] [float] NULL ,
	[SLQtyP21] [float] NULL ,
	[SLQtyP22] [float] NULL ,
	[SLQtyP23] [float] NULL ,
	[SLQtyP24] [float] NULL ,
	[SLQtyP25] [float] NULL ,
	[SLQtyP26] [float] NULL ,
	[SLSalesY1] [money] NULL ,
	[SLSalesY2] [money] NULL ,
	[SLSalesY3] [money] NULL ,
	[SLSalesY4] [money] NULL ,
	[SLCostsY1] [money] NULL ,
	[SLCostsY2] [money] NULL ,
	[SLCostsY3] [money] NULL ,
	[SLCostsY4] [money] NULL ,
	[SLQtyY1] [float] NULL ,
	[SLQtyY2] [float] NULL ,
	[SLQtyY3] [float] NULL ,
	[SLQtyY4] [float] NULL ,
	[SLBudgetP1] [money] NULL ,
	[SLBudgetP2] [money] NULL ,
	[SLBudgetP3] [money] NULL ,
	[SLBudgetP4] [money] NULL ,
	[SLBudgetP5] [money] NULL ,
	[SLBudgetP6] [money] NULL ,
	[SLBudgetP7] [money] NULL ,
	[SLBudgetP8] [money] NULL ,
	[SLBudgetP9] [money] NULL ,
	[SLBudgetP10] [money] NULL ,
	[SLBudgetP11] [money] NULL ,
	[SLBudgetP12] [money] NULL ,
	[SLBudgetP13] [money] NULL ,
	[SLBudgetP14] [money] NULL ,
	[SLBudgetP15] [money] NULL ,
	[SLBudgetP16] [money] NULL ,
	[SLBudgetP17] [money] NULL ,
	[SLBudgetP18] [money] NULL ,
	[SLBudgetP19] [money] NULL ,
	[SLBudgetP20] [money] NULL ,
	[SLBudgetP21] [money] NULL ,
	[SLBudgetP22] [money] NULL ,
	[SLBudgetP23] [money] NULL ,
	[SLBudgetP24] [money] NULL ,
	[SLBudgetP25] [money] NULL ,
	[SLBudgetP26] [money] NULL ,
	[SLBudgetY1] [float] NULL ,
	[SLBudgetY2] [float] NULL ,
	[SLBudgetY3] [float] NULL ,
	[SLBudgetY4] [float] NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Stock SerialBatch]    Script Date: 20/12/2004 07:21:30 ******/
CREATE TABLE [dbo].[Stock SerialBatch] (
	[SRID] [int] IDENTITY (1, 1) NOT NULL ,
	[SRStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRSerialNo] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRInOurRef] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRBatchNo] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SROutOurRef] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRInOrderLineID] [int] NULL ,
	[SROutOrderLineID] [int] NULL ,
	[SRDateIn] [smalldatetime] NULL ,
	[SRDateOut] [smalldatetime] NULL ,
	[SRInQty] [float] NULL ,
	[SROutQty] [float] NULL ,
	[SRInLocation] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SROutLocation] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRCostPrice] [float] NULL ,
	[SRCostCur] [tinyint] NULL ,
	[SRCostCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRSellPrice] [float] NULL ,
	[SRSellCur] [tinyint] NOT NULL ,
	[SRSellCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRSold] [bit] NOT NULL ,
	[SRBatchRec] [int] NOT NULL ,
	[SRBatchChild] [int] NOT NULL ,
	[SRCoRate] [float] NULL ,
	[SRDailyRate] [float] NULL ,
	[SRDateUseX] [smalldatetime] NULL ,
	[SRNotes] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRType] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[SRLastUpdate] [smalldatetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

/****** Object:  Table [dbo].[TeleSales History]    Script Date: 20/12/2004 07:21:30 ******/
CREATE TABLE [dbo].[TeleSales History] (
	[HTID] [int] IDENTITY (1, 1) NOT NULL ,
	[HTStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[HTAcCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[HTLast Date] [smalldatetime] NULL ,
	[HTLast Price] [float] NULL ,
	[HTLineID] [int] NULL ,
	[HTLast qty] [float] NULL ,
	[HTDelivery] [bit] NOT NULL ,
	[HTSystem Flag] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[Trans AutoDates]    Script Date: 20/12/2004 07:21:30 ******/
CREATE TABLE [dbo].[Trans AutoDates] (
	[TAOurRef] [nvarchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[TANext Date] [smalldatetime] NULL ,
	[TARepeat until date] [smalldatetime] NULL ,
	[TANext Period] [int] NULL ,
	[TANext Year] [int] NULL ,
	[TAUntil Period] [int] NULL ,
	[TAUntil Year] [int] NULL ,
	[TAIncrement units] [int] NULL ,
	[TAWhen posting daybook] [bit] NOT NULL ,
	[TAType] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO

/****** Object:  Table [dbo].[TransLine]    Script Date: 20/12/2004 07:21:30 ******/
CREATE TABLE [dbo].[TransLine] (
	[TLLineID] [int] IDENTITY (1, 1) NOT NULL ,
	[TLFolio] [int] NULL ,
	[TLLine No] [int] NULL ,
	[TLABSLineNo] [int] NULL ,
	[TLOurRef] [nvarchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLDescription] [nvarchar] (55) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLQty] [float] NULL ,
	[TLQtyDel] [float] NULL ,
	[TLQtyMul] [float] NULL ,
	[TLQtyPicked] [float] NULL ,
	[TLQtyPickedWO] [float] NULL ,
	[TLQtyWOFF] [float] NULL ,
	[TLStCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLRateCode] [nvarchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser1] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser2] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser3] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser4] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser5] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser6] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser7] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser8] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser9] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLUser10] [nvarchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLCost Centre] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLDeaprtment] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLLocation] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLPayment] [bit] NOT NULL ,
	[TLAcCode] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLAcCodeIncDel] [nvarchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLAnalyisCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLJobCode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLChargeCurrency] [tinyint] NULL ,
	[TLChargeCurrencySYMBOL] [nvarchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLVATCode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLVATRate] [float] NULL ,
	[TLSSDSalesUnit] [float] NULL ,
	[TLSSDCountry] [nvarchar] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLSSDCommodCode] [nvarchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLTotalWeight] [float] NULL ,
	[TLGLCode] [int] NULL ,
	[TLSigned] [float] NULL ,
	[TLLineType] [tinyint] NULL ,
	[TLTypeYearPeriod] [nvarchar] (7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLTotalVATInCur] [float] NULL ,
	[TLUnitPriceInCur] [float] NULL ,
	[TLTotalNettInCur] [float] NULL ,
	[TLTotalCostInCur] [float] NULL ,
	[TLTotalDiscInCur] [float] NULL ,
	[TLTotalGrossInCur] [float] NULL ,
	[TLTotalVATInBase] [float] NULL ,
	[TLUnitPriceInBase] [float] NULL ,
	[TLTotalNettInBase] [float] NULL ,
	[TLTotalCostInBase] [float] NULL ,
	[TLTotalDiscInBase] [float] NULL ,
	[TLTotalGrossInBase] [float] NULL ,
	[TLPaymentInBase] [float] NULL ,
	[TLPaymentInCur] [float] NULL ,
	[TLDailyRate] [float] NULL ,
	[TLCompanyRate] [float] NULL ,
	[TLInclusiveVATCode] [nvarchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TLPriceMultiplier] [float] NULL ,
	[TLLastUpdate] [smalldatetime] NULL ,
	[TLGP] [float] NULL ,
	[TLVATIncValue] [float] NULL ,
	[TLB2BLineNo] [int] NULL ,
	[TLB2BLinkFolio] [int] NULL ,
	[TLCOSDailyRate] [float] NULL ,
	[TLCostApport] [float] NULL ,
	[TLUseQtyMul] [bit] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Cost Centre] WITH NOCHECK ADD 
	CONSTRAINT [PK_Cost Centre] PRIMARY KEY  CLUSTERED 
	(
		[CCCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Currency] WITH NOCHECK ADD 
	CONSTRAINT [PK_Currency] PRIMARY KEY  CLUSTERED 
	(
		[CurNo]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[CustSupp] WITH NOCHECK ADD 
	CONSTRAINT [PK_CustSupp] PRIMARY KEY  CLUSTERED 
	(
		[CSAcCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Department] WITH NOCHECK ADD 
	CONSTRAINT [PK_Department] PRIMARY KEY  CLUSTERED 
	(
		[DPCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[GL] WITH NOCHECK ADD 
	CONSTRAINT [PK_GL] PRIMARY KEY  CLUSTERED 
	(
		[GLCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Job] WITH NOCHECK ADD 
	CONSTRAINT [PK_Job] PRIMARY KEY  CLUSTERED 
	(
		[JBJobCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[JobAnalysis] WITH NOCHECK ADD 
	CONSTRAINT [PK_JobAnalysis] PRIMARY KEY  CLUSTERED 
	(
		[JAAnalCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[JobAnalysisTotals] WITH NOCHECK ADD 
	CONSTRAINT [PK_JobAnalysisTotals] PRIMARY KEY  CLUSTERED 
	(
		[JTID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[JobEmployee] WITH NOCHECK ADD 
	CONSTRAINT [PK_JobEmployee] PRIMARY KEY  CLUSTERED 
	(
		[JEEmpCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[JobRate] WITH NOCHECK ADD 
	CONSTRAINT [PK_JobRate] PRIMARY KEY  CLUSTERED 
	(
		[JRRateCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Location] WITH NOCHECK ADD 
	CONSTRAINT [PK_Location] PRIMARY KEY  CLUSTERED 
	(
		[LOCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Notes] WITH NOCHECK ADD 
	CONSTRAINT [PK_Notes] PRIMARY KEY  CLUSTERED 
	(
		[NOID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[OutStandingTrans] WITH NOCHECK ADD 
	CONSTRAINT [PK_OutStandingTrans] PRIMARY KEY  CLUSTERED 
	(
		[OTID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[OutstandingOrders] WITH NOCHECK ADD 
	CONSTRAINT [PK_OutstandingOrders] PRIMARY KEY  CLUSTERED 
	(
		[ORID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Periods Description] WITH NOCHECK ADD 
	CONSTRAINT [PK_Periods Description] PRIMARY KEY  CLUSTERED 
	(
		[Period]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Stock] WITH NOCHECK ADD 
	CONSTRAINT [PK_Stock] PRIMARY KEY  CLUSTERED 
	(
		[STCode]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[System Audit] WITH NOCHECK ADD 
	CONSTRAINT [PK_System Audit] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[SystemVars] WITH NOCHECK ADD 
	CONSTRAINT [PK_SystemVars] PRIMARY KEY  CLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TransHeader] WITH NOCHECK ADD 
	CONSTRAINT [PK_TransHeader] PRIMARY KEY  CLUSTERED 
	(
		[THFolio]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[CustSupp Discount] WITH NOCHECK ADD 
	CONSTRAINT [PK_CustSupp Discount] PRIMARY KEY  CLUSTERED 
	(
		[DSID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Stock Alt Codes] WITH NOCHECK ADD 
	CONSTRAINT [PK_Stock Alt Codes] PRIMARY KEY  CLUSTERED 
	(
		[SAID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Stock BOM] WITH NOCHECK ADD 
	CONSTRAINT [PK_Stock BOM] PRIMARY KEY  CLUSTERED 
	(
		[SBID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Stock Discount] WITH NOCHECK ADD 
	CONSTRAINT [PK_Stock Discount] PRIMARY KEY  CLUSTERED 
	(
		[SDID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Stock Location] WITH NOCHECK ADD 
	CONSTRAINT [PK_Stock Location] PRIMARY KEY  CLUSTERED 
	(
		[SLID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Stock SerialBatch] WITH NOCHECK ADD 
	CONSTRAINT [PK_Stock SerialBatch] PRIMARY KEY  CLUSTERED 
	(
		[SRID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TeleSales History] WITH NOCHECK ADD 
	CONSTRAINT [PK_TeleSales History] PRIMARY KEY  CLUSTERED 
	(
		[HTID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Trans AutoDates] WITH NOCHECK ADD 
	CONSTRAINT [PK_Trans AutoDates] PRIMARY KEY  CLUSTERED 
	(
		[TAOurRef]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[TransLine] WITH NOCHECK ADD 
	CONSTRAINT [PK_TransLine] PRIMARY KEY  CLUSTERED 
	(
		[TLLineID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[Currency] ADD 
	CONSTRAINT [DF_Currency_DailyRate] DEFAULT (0) FOR [DailyRate],
	CONSTRAINT [DF_Currency_CompanyRate] DEFAULT (0) FOR [CompanyRate],
	CONSTRAINT [DF_Currency_TriEuro] DEFAULT (0) FOR [TriEuro],
	CONSTRAINT [DF_Currency_TriRates] DEFAULT (0) FOR [TriRates],
	CONSTRAINT [DF_Currency_TriInvert] DEFAULT (0) FOR [TriInvert],
	CONSTRAINT [DF_Currency_TriFloat] DEFAULT (0) FOR [TriFloat]
GO

ALTER TABLE [dbo].[CustSupp] ADD 
	CONSTRAINT [DF_CustSupp_CSOwnTerms] DEFAULT (0) FOR [CSOwnTerms],
	CONSTRAINT [DF_CustSupp_CSPayment Terms] DEFAULT (0) FOR [CSPayment Terms],
	CONSTRAINT [DF_CustSupp_CSCredit limit] DEFAULT (0) FOR [CSCredit limit],
	CONSTRAINT [DF_CustSupp_CSDiscount] DEFAULT (0) FOR [CSDiscount],
	CONSTRAINT [DF_CustSupp_CSEECMember] DEFAULT (0) FOR [CSEECMember],
	CONSTRAINT [DF_CustSupp_CSSalesGL] DEFAULT (0) FOR [CSSalesGL],
	CONSTRAINT [DF_CustSupp_CSCostOfSalesGL] DEFAULT (0) FOR [CSCostOfSalesGL],
	CONSTRAINT [DF_CustSupp_CSCtrlGL] DEFAULT (0) FOR [CSCtrlGL],
	CONSTRAINT [DF_CustSupp_CSOrder Value] DEFAULT (0) FOR [CSOrder Value],
	CONSTRAINT [DF_CustSupp_CSDirect Debit Mode] DEFAULT (0) FOR [CSDirect Debit Mode],
	CONSTRAINT [DF_CustSupp_CSSettlement Days] DEFAULT (0) FOR [CSSettlement Days],
	CONSTRAINT [DF_CustSupp_CSSettlement Discount] DEFAULT (0) FOR [CSSettlement Discount],
	CONSTRAINT [DF_CustSupp_CSForm No] DEFAULT (0) FOR [CSForm No],
	CONSTRAINT [DF_CustSupp_CSTagNo] DEFAULT (0) FOR [CSTagNo],
	CONSTRAINT [DF_CustSupp_CSSSD Mode] DEFAULT (0) FOR [CSSSD Mode]
GO

 CREATE  INDEX [IX_CustSupp] ON [dbo].[CustSupp]([CSPostCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_CustSupp_1] ON [dbo].[CustSupp]([CSSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Department] ON [dbo].[Department]([DPCode]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[GL] ADD 
	CONSTRAINT [DF_GL_GLLevel] DEFAULT (0) FOR [GLLevel]
GO

ALTER TABLE [dbo].[Job] ADD 
	CONSTRAINT [DF_Job_JBJobFolio] DEFAULT (0) FOR [JBJobFolio],
	CONSTRAINT [DF_Job_JBCurrency] DEFAULT (0) FOR [JBCurrency],
	CONSTRAINT [DF_Job_JBLevel] DEFAULT (0) FOR [JBLevel]
GO

 CREATE  INDEX [IX_Job_1] ON [dbo].[Job]([JBJobAltCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Job] ON [dbo].[Job]([JBCustCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Job_2] ON [dbo].[Job]([JBSystem Flag]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[JobAnalysis] ADD 
	CONSTRAINT [DF_JobAnalysis_JAAnalOrder] DEFAULT (0) FOR [JAAnalOrder],
	CONSTRAINT [DF_JobAnalysis_JACategoryHistFolio] DEFAULT (0) FOR [JACategoryHistFolio]
GO

 CREATE  INDEX [IX_JobAnalysis] ON [dbo].[JobAnalysis]([JASystem Flag]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[JobAnalysisTotals] ADD 
	CONSTRAINT [DF_JobAnalysisTotals_JTHistFolio] DEFAULT (0) FOR [JTHistFolio]
GO

 CREATE  INDEX [IX_JobAnalysisTotals] ON [dbo].[JobAnalysisTotals]([JTJobCode], [JTAnalCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_JobAnalysisTotals_1] ON [dbo].[JobAnalysisTotals]([JTSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_JobAnalysisTotals_2] ON [dbo].[JobAnalysisTotals]([JTAnalCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_JobEmployee] ON [dbo].[JobEmployee]([JESystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_JobRate] ON [dbo].[JobRate]([JREmpCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_JobRate_1] ON [dbo].[JobRate]([JRSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_OutStandingTrans] ON [dbo].[OutStandingTrans]([OTAcCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_OutStandingTrans_1] ON [dbo].[OutStandingTrans]([OTOurRef]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_OutStandingTrans_2] ON [dbo].[OutStandingTrans]([OTSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_OutstandingOrders] ON [dbo].[OutstandingOrders]([ORAcCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_OutstandingOrders_1] ON [dbo].[OutstandingOrders]([OROurRef]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_OutstandingOrders_2] ON [dbo].[OutstandingOrders]([ORSystem Flag]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Stock] ADD 
	CONSTRAINT [DF_Stock_STQtyFree] DEFAULT (0) FOR [STQtyFree],
	CONSTRAINT [DF_Stock_STCostOfSaleGL] DEFAULT (0) FOR [STCostOfSaleGL],
	CONSTRAINT [DF_Stock_STSalesGL] DEFAULT (0) FOR [STSalesGL],
	CONSTRAINT [DF_Stock_STPLGL] DEFAULT (0) FOR [STPLGL],
	CONSTRAINT [DF_Stock_STBalGL] DEFAULT (0) FOR [STBalGL],
	CONSTRAINT [DF_Stock_STWIPGL] DEFAULT (0) FOR [STWIPGL],
	CONSTRAINT [DF_Stock_STShow Qty as Packs] DEFAULT (0) FOR [STShow Qty as Packs],
	CONSTRAINT [DF_Stock_STInclude on Web] DEFAULT (0) FOR [STInclude on Web],
	CONSTRAINT [DF_Stock_STUseForEbus] DEFAULT (0) FOR [STUseForEbus],
	CONSTRAINT [DF_Stock_STBelowMinLevel] DEFAULT (0) FOR [STBelowMinLevel],
	CONSTRAINT [DF_Stock_STCoverUse] DEFAULT (0) FOR [STCoverUse],
	CONSTRAINT [DF_Stock_STWOPAutoCalcTime] DEFAULT (0) FOR [STWOPAutoCalcTime],
	CONSTRAINT [DF_Stock_STUsesBins] DEFAULT (0) FOR [STUsesBins],
	CONSTRAINT [DF_Stock_STShowKitOnSales] DEFAULT (0) FOR [STShowKitOnSales]
GO

 CREATE  INDEX [IX_Stock] ON [dbo].[Stock]([STSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock_1] ON [dbo].[Stock]([STStockFolio]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock_2] ON [dbo].[Stock]([STSystem Flag]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[SystemVars] ADD 
	CONSTRAINT [DF_SystemVars_Year] DEFAULT (0) FOR [Year],
	CONSTRAINT [DF_SystemVars_ExchYear] DEFAULT (0) FOR [ExchYear],
	CONSTRAINT [DF_SystemVars_Period] DEFAULT (0) FOR [Period],
	CONSTRAINT [DF_SystemVars_PeriodsInYear] DEFAULT (0) FOR [PeriodsInYear],
	CONSTRAINT [DF_SystemVars_ReReadStockHeadings] DEFAULT (0) FOR [ReReadStockHeadings],
	CONSTRAINT [DF_SystemVars_ReReadJobHeadings] DEFAULT (0) FOR [ReReadJobHeadings],
	CONSTRAINT [DF_SystemVars_ReReadJobBudgets] DEFAULT (0) FOR [ReReadJobBudgets],
	CONSTRAINT [DF_SystemVars_QtyDP] DEFAULT (0) FOR [QtyDP],
	CONSTRAINT [DF_SystemVars_SalesCurDP] DEFAULT (0) FOR [SalesCurDP],
	CONSTRAINT [DF_SystemVars_CostCurDP] DEFAULT (0) FOR [CostCurDP],
	CONSTRAINT [DF_SystemVars_NoErrors] DEFAULT (0) FOR [NoErrors],
	CONSTRAINT [DF_SystemVars_FileVersion] DEFAULT (0) FOR [FileVersion],
	CONSTRAINT [DF_SystemVars_RunNO] DEFAULT (0) FOR [RunNO],
	CONSTRAINT [DF_SystemVars_Flag1] DEFAULT (0) FOR [Flag1],
	CONSTRAINT [DF_SystemVars_Flag2] DEFAULT (0) FOR [Flag2],
	CONSTRAINT [DF_SystemVars_Flag3] DEFAULT (0) FOR [Flag3],
	CONSTRAINT [DF_SystemVars_Flag4] DEFAULT (0) FOR [Flag4],
	CONSTRAINT [DF_SystemVars_Flag5] DEFAULT (0) FOR [Flag5],
	CONSTRAINT [DF_SystemVars_Flag6] DEFAULT (0) FOR [Flag6],
	CONSTRAINT [DF_SystemVars_Flag7] DEFAULT (0) FOR [Flag7],
	CONSTRAINT [DF_SystemVars_Flag8] DEFAULT (0) FOR [Flag8],
	CONSTRAINT [DF_SystemVars_Flag9] DEFAULT (0) FOR [Flag9],
	CONSTRAINT [DF_SystemVars_Flag10] DEFAULT (0) FOR [Flag10],
	CONSTRAINT [DF_SystemVars_Flag11] DEFAULT (0) FOR [Flag11],
	CONSTRAINT [DF_SystemVars_Flag12] DEFAULT (0) FOR [Flag12],
	CONSTRAINT [DF_SystemVars_Flag13] DEFAULT (0) FOR [Flag13],
	CONSTRAINT [DF_SystemVars_Flag14] DEFAULT (0) FOR [Flag14],
	CONSTRAINT [DF_SystemVars_Flag15] DEFAULT (0) FOR [Flag15],
	CONSTRAINT [DF_SystemVars_Flag16] DEFAULT (0) FOR [Flag16],
	CONSTRAINT [DF_SystemVars_Flag17] DEFAULT (0) FOR [Flag17],
	CONSTRAINT [DF_SystemVars_Flag18] DEFAULT (0) FOR [Flag18],
	CONSTRAINT [DF_SystemVars_Flag19] DEFAULT (0) FOR [Flag19],
	CONSTRAINT [DF_SystemVars_Flag20] DEFAULT (0) FOR [Flag20],
	CONSTRAINT [DF_SystemVars_Var1] DEFAULT (0) FOR [Var1],
	CONSTRAINT [DF_SystemVars_Var2] DEFAULT (0) FOR [Var2],
	CONSTRAINT [DF_SystemVars_Var3] DEFAULT (0) FOR [Var3],
	CONSTRAINT [DF_SystemVars_Var4] DEFAULT (0) FOR [Var4],
	CONSTRAINT [DF_SystemVars_Var5] DEFAULT (0) FOR [Var5],
	CONSTRAINT [DF_SystemVars_Var6] DEFAULT (0) FOR [Var6],
	CONSTRAINT [DF_SystemVars_Var7] DEFAULT (0) FOR [Var7],
	CONSTRAINT [DF_SystemVars_Var8] DEFAULT (0) FOR [Var8],
	CONSTRAINT [DF_SystemVars_Var9] DEFAULT (0) FOR [Var9],
	CONSTRAINT [DF_SystemVars_Var10] DEFAULT (0) FOR [Var10]
GO

ALTER TABLE [dbo].[TransHeader] ADD 
	CONSTRAINT [DF_TransHeader_THRunNo] DEFAULT (0) FOR [THRunNo],
	CONSTRAINT [DF_TransHeader_THPosted] DEFAULT (0) FOR [THPosted],
	CONSTRAINT [DF_TransHeader_THControlGL] DEFAULT (0) FOR [THControlGL],
	CONSTRAINT [DF_TransHeader_THManualVAT] DEFAULT (0) FOR [THManualVAT],
	CONSTRAINT [DF_TransHeader_THNoLabels] DEFAULT (0) FOR [THNoLabels],
	CONSTRAINT [DF_TransHeader_THSettlementDays] DEFAULT (0) FOR [THSettlementDays],
	CONSTRAINT [DF_TransHeader_THYear] DEFAULT (0) FOR [THYear],
	CONSTRAINT [DF_TransHeader_THPeriod] DEFAULT (0) FOR [THPeriod],
	CONSTRAINT [DF_TransHeader_THSSDTransportMode] DEFAULT (0) FOR [THSSDTransportMode],
	CONSTRAINT [DF_TransHeader_THSSDTransportNature] DEFAULT (0) FOR [THSSDTransportNature],
	CONSTRAINT [DF_TransHeader_THNoLines] DEFAULT (0) FOR [THNoLines],
	CONSTRAINT [DF_TransHeader_THTagged] DEFAULT (0) FOR [THTagged],
	CONSTRAINT [IX_TransHeader_3] UNIQUE  NONCLUSTERED 
	(
		[THOurRef]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_TransHeader] ON [dbo].[TransHeader]([THSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransHeader_1] ON [dbo].[TransHeader]([THAcCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransHeader_2] ON [dbo].[TransHeader]([THEmployeeCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransHeader_4] ON [dbo].[TransHeader]([THRunNo]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransHeader_5] ON [dbo].[TransHeader]([THYearPeriod]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_CustSupp Discount] ON [dbo].[CustSupp Discount]([DSAcCode], [DSStCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_CustSupp Discount_1] ON [dbo].[CustSupp Discount]([DSSystem Flag]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Stock Alt Codes] ADD 
	CONSTRAINT [DF_Stock Alt Codes_SAROCurr] DEFAULT (0) FOR [SAROCurr],
	CONSTRAINT [DF_Stock Alt Codes_SAUseROPrice] DEFAULT (0) FOR [SAUseROPrice]
GO

 CREATE  INDEX [IX_Stock Alt Codes] ON [dbo].[Stock Alt Codes]([SAStCode], [SAAltCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock Alt Codes_1] ON [dbo].[Stock Alt Codes]([SAAltCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock Alt Codes_2] ON [dbo].[Stock Alt Codes]([SASuppCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock Alt Codes_3] ON [dbo].[Stock Alt Codes]([SASystem Flag]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Stock BOM] ADD 
	CONSTRAINT [DF_Stock BOM_SBFlag] DEFAULT (0) FOR [SBFlag],
	CONSTRAINT [DF_Stock BOM_SBAnother BOM] DEFAULT (0) FOR [SBAnother BOM]
GO

 CREATE  INDEX [IX_Stock BOM] ON [dbo].[Stock BOM]([SBParStCode], [SBOrder]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock BOM_1] ON [dbo].[Stock BOM]([SBSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock Discount] ON [dbo].[Stock Discount]([SDSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock Discount_1] ON [dbo].[Stock Discount]([SDStCode], [SDFrom]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock Location] ON [dbo].[Stock Location]([SLSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock Location_1] ON [dbo].[Stock Location]([SLStCode], [SLLocation]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Stock SerialBatch] ADD 
	CONSTRAINT [DF_Stock SerialBatch_SRInOrderLineID] DEFAULT (0) FOR [SRInOrderLineID],
	CONSTRAINT [DF_Stock SerialBatch_SROutOrderLineID] DEFAULT (0) FOR [SROutOrderLineID],
	CONSTRAINT [DF_Stock SerialBatch_SRCostCur] DEFAULT (0) FOR [SRCostCur],
	CONSTRAINT [DF_Stock SerialBatch_SRSellCur] DEFAULT (0) FOR [SRSellCur],
	CONSTRAINT [DF_Stock SerialBatch_SRSold] DEFAULT (0) FOR [SRSold],
	CONSTRAINT [DF_Stock SerialBatch_SRBatchRec] DEFAULT (0) FOR [SRBatchRec],
	CONSTRAINT [DF_Stock SerialBatch_SRBatchChild] DEFAULT (0) FOR [SRBatchChild]
GO

 CREATE  INDEX [IX_Stock SerialBatch] ON [dbo].[Stock SerialBatch]([SRStCode], [SRSerialNo], [SRInOurRef]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock SerialBatch_1] ON [dbo].[Stock SerialBatch]([SRInOurRef]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock SerialBatch_2] ON [dbo].[Stock SerialBatch]([SRInOrderLineID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock SerialBatch_3] ON [dbo].[Stock SerialBatch]([SROutOrderLineID]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock SerialBatch_4] ON [dbo].[Stock SerialBatch]([SROutOurRef]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_Stock SerialBatch_5] ON [dbo].[Stock SerialBatch]([SRSystem Flag]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[TeleSales History] ADD 
	CONSTRAINT [DF_TeleSales History_HTLineID] DEFAULT (0) FOR [HTLineID],
	CONSTRAINT [DF_TeleSales History_HTDelivery] DEFAULT (0) FOR [HTDelivery]
GO

 CREATE  INDEX [IX_TeleSales History] ON [dbo].[TeleSales History]([HTStCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TeleSales History_1] ON [dbo].[TeleSales History]([HTSystem Flag]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TeleSales History_2] ON [dbo].[TeleSales History]([HTAcCode]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Trans AutoDates] ADD 
	CONSTRAINT [DF_Trans AutoDates_TANext Period] DEFAULT (0) FOR [TANext Period],
	CONSTRAINT [DF_Trans AutoDates_TANext Year] DEFAULT (0) FOR [TANext Year],
	CONSTRAINT [DF_Trans AutoDates_TAUntil Period] DEFAULT (0) FOR [TAUntil Period],
	CONSTRAINT [DF_Trans AutoDates_TAUntil Year] DEFAULT (0) FOR [TAUntil Year],
	CONSTRAINT [DF_Trans AutoDates_TAIncrement units] DEFAULT (0) FOR [TAIncrement units],
	CONSTRAINT [DF_Trans AutoDates_TAWhen posting daybook] DEFAULT (0) FOR [TAWhen posting daybook]
GO

ALTER TABLE [dbo].[TransLine] ADD 
	CONSTRAINT [DF_TransLine_TLFolio] DEFAULT (0) FOR [TLFolio],
	CONSTRAINT [DF_TransLine_TLLine No] DEFAULT (0) FOR [TLLine No],
	CONSTRAINT [DF_TransLine_TLABSLineNo] DEFAULT (0) FOR [TLABSLineNo],
	CONSTRAINT [DF_TransLine_TLPayment] DEFAULT (0) FOR [TLPayment],
	CONSTRAINT [DF_TransLine_TLChargeCurrency] DEFAULT (0) FOR [TLChargeCurrency],
	CONSTRAINT [DF_TransLine_TLGLCode] DEFAULT (0) FOR [TLGLCode],
	CONSTRAINT [DF_TransLine_TLLineType] DEFAULT (0) FOR [TLLineType],
	CONSTRAINT [DF_TransLine_TLB2BLineNo] DEFAULT (0) FOR [TLB2BLineNo],
	CONSTRAINT [DF_TransLine_TLB2BLinkFolio] DEFAULT (0) FOR [TLB2BLinkFolio],
	CONSTRAINT [DF_TransLine_TLUseQtyMul] DEFAULT (0) FOR [TLUseQtyMul]
GO

 CREATE  INDEX [IX_TransLine] ON [dbo].[TransLine]([TLFolio], [TLLine No]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransLine_1] ON [dbo].[TransLine]([TLFolio], [TLLine No]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransLine_2] ON [dbo].[TransLine]([TLAcCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransLine_3] ON [dbo].[TransLine]([TLFolio]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransLine_4] ON [dbo].[TransLine]([TLJobCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransLine_5] ON [dbo].[TransLine]([TLRateCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransLine_6] ON [dbo].[TransLine]([TLStCode]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_TransLine_7] ON [dbo].[TransLine]([TLTypeYearPeriod]) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CustSupp Discount] ADD 
	CONSTRAINT [FK_CustSupp Discount_CustSupp] FOREIGN KEY 
	(
		[DSAcCode]
	) REFERENCES [dbo].[CustSupp] (
		[CSAcCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[Stock Alt Codes] ADD 
	CONSTRAINT [FK_Stock Alt Codes_Stock] FOREIGN KEY 
	(
		[SAAltCode]
	) REFERENCES [dbo].[Stock] (
		[STCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[Stock BOM] ADD 
	CONSTRAINT [FK_Stock BOM_Stock] FOREIGN KEY 
	(
		[SBParStCode]
	) REFERENCES [dbo].[Stock] (
		[STCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[Stock Discount] ADD 
	CONSTRAINT [FK_Stock Discount_Stock] FOREIGN KEY 
	(
		[SDStCode]
	) REFERENCES [dbo].[Stock] (
		[STCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[Stock Location] ADD 
	CONSTRAINT [FK_Stock Location_Stock] FOREIGN KEY 
	(
		[SLStCode]
	) REFERENCES [dbo].[Stock] (
		[STCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[Stock SerialBatch] ADD 
	CONSTRAINT [FK_Stock SerialBatch_Stock] FOREIGN KEY 
	(
		[SRStCode]
	) REFERENCES [dbo].[Stock] (
		[STCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[TeleSales History] ADD 
	CONSTRAINT [FK_TeleSales History_CustSupp] FOREIGN KEY 
	(
		[HTAcCode]
	) REFERENCES [dbo].[CustSupp] (
		[CSAcCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE ,
	CONSTRAINT [FK_TeleSales History_Stock] FOREIGN KEY 
	(
		[HTStCode]
	) REFERENCES [dbo].[Stock] (
		[STCode]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[Trans AutoDates] ADD 
	CONSTRAINT [FK_Trans AutoDates_TransHeader] FOREIGN KEY 
	(
		[TAOurRef]
	) REFERENCES [dbo].[TransHeader] (
		[THOurRef]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO

ALTER TABLE [dbo].[TransLine] ADD 
	CONSTRAINT [FK_TransLine_TransHeader] FOREIGN KEY 
	(
		[TLFolio]
	) REFERENCES [dbo].[TransHeader] (
		[THFolio]
	) ON DELETE CASCADE  ON UPDATE CASCADE 
GO


exec sp_addextendedproperty N'MS_Description', null, N'user', N'dbo', N'table', N'CustSupp', N'column', N'CSOrder Value'


GO

