CREATE COLUMN TABLE "SBODEMODE"."AISD" ("DocEntry" INTEGER CS_INT NOT NULL , "DocNum" INTEGER CS_INT NOT NULL , "SrcLctCode" INTEGER CS_INT, "SrcLctName" NVARCHAR(100), "Series" INTEGER CS_INT, "PostDate" LONGDATE CS_LONGDATE, "DocDate" LONGDATE CS_LONGDATE, "DocStatus" NVARCHAR(1) DEFAULT 'O', "Revised" NVARCHAR(1) DEFAULT 'N', "OrgRefNo" NVARCHAR(100), "OrgRefEty" INTEGER CS_INT, "OrgDocDate" LONGDATE CS_LONGDATE, "Comments" NVARCHAR(254), "ObjType" NVARCHAR(20), "DataSource" NVARCHAR(1) DEFAULT 'N', "UserSign" SMALLINT CS_INT, "LogInstanc" INTEGER CS_INT DEFAULT 0 NOT NULL , "CreateDate" LONGDATE CS_LONGDATE, "UserSign2" SMALLINT CS_INT, "UpdateDate" LONGDATE CS_LONGDATE, "Handwrtten" NVARCHAR(1) DEFAULT 'N', "PIndicator" NVARCHAR(10) NOT NULL , "DstPercent" DECIMAL(21,6) CS_FIXED, "BPLId" INTEGER CS_INT, "BPLName" NVARCHAR(200), "VATRegNum" NVARCHAR(32), "SrcDocType" INTEGER CS_INT, "FromNum" INTEGER CS_INT, "ToNum" INTEGER CS_INT, "FromDate" LONGDATE CS_LONGDATE, "ToDate" LONGDATE CS_LONGDATE, PRIMARY KEY ("DocEntry", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE CPBTREE INDEX "AISD_INDEX" ON "SBODEMODE"."AISD" ( "DocNum" ASC, "PIndicator" ASC, "LogInstanc" ASC )