STINVTOT tablosunu oluşturmak için ;
CREATE TABLE [dbo].[LG_004_01_STINVTOT]
(
[LOGICALREF] [int] IDENTITY(19,1) NOT NULL,
[STOCKREF] [int] NULL,
[INVENNO] [smallint] NULL,
[DATE_] [datetime] NULL,
[PLNPRODIN] [float] NULL,
[PLNPRODOUT] [float] NULL,
[PLNOTHERIN] [float] NULL,
[PLNOTHEROUT] [float] NULL,
[PLNWHOUSEIN] [float] NULL,
[PLNWHOUSEOUT] [float] NULL,
[TEMPIN] [float] NULL,
[TEMPOUT] [float] NULL,
[RESERVED] [float] NULL,
[ACTPORDER] [float] NULL,
[RECEIVED] [float] NULL,
[ACTPRODIN] [float] NULL,
[ACTOTHERIN] [float] NULL,
[ACTSORDER] [float] NULL,
[SHIPPED] [float] NULL,
[ACTWASTE] [float] NULL,
[ACTOTHEROUT] [float] NULL,
[TRANSFERRED] [float] NULL,
[AVGVALUE] [float] NULL,
[AVGCURRVAL] [float] NULL,
[PURAMNT] [float] NULL,
[PURCASH] [float] NULL,
[PURCURR] [float] NULL,
[SALAMNT] [float] NULL,
[SALCASH] [float] NULL,
[SALCURR] [float] NULL,
[LASTTRDATE] [datetime] NULL,
[ONHAND] [float] NULL,
[ACTWHOUSEIN] [float] NULL,
[ACTWHOUSEOUT] [float] NULL,
[COUNTADD] [float] NULL,
[COUNTDEC] [float] NULL,
[DISTRESERVED] [float] NULL,
[ONVEHICLE] [float] NULL,
[VARIANTREF] [int] NULL,
[INVENCOSTGRP] [smallint] NULL,
CONSTRAINT [I004_01_STINVTOT_I1] PRIMARY KEY CLUSTERED
( [LOGICALREF] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY]
I004_01_SRVTOT_I2 index için;
CREATE UNIQUE NONCLUSTERED INDEX [I004_01_SRVTOT_I2] ON [dbo].[LG_004_01_SRVTOT]
(
[CARDREF] ASC,
[INVENNO] ASC,
[MONTH_] ASC,
[YEAR_] ASC
)WITH (PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]