CREATE COLUMN TABLE "SBODEMOPT"."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(100), "VATRegNum" NVARCHAR(32), PRIMARY KEY ("DocEntry", "LogInstanc")) UNLOAD PRIORITY 5  AUTO MERGE ;
CREATE UNIQUE INDEX "AISD_INDEX" ON "SBODEMOPT"."AISD" ( "DocNum" ASC, "PIndicator" ASC, "LogInstanc" ASC )