if not Exists(SELECT * FROM information_schema.tables where Table_name = 'StoreDocumentAccount') begin create table StoreDocumentAccount ( ID int primary key, FC_ID int references Finance_Cycle (ID) not null, Code int not null, ToDate int not null, Description nvarchar(1000), Kar_ID_Creator int references karbar(ID) not null, TarikhSabt int not null, SaatSabt int not null ) end ; if not Exists(SELECT * FROM information_schema.tables where Table_name = 'StoreDocumentAccountItem') begin create table StoreDocumentAccountItem ( ID int primary key identity(1,1), SDA_ID int references StoreDocumentAccount (ID) not null, SDI_ID int references StoreDocumentItem (ID) not null, Dom_ID_PriceType int references Domain(ID) not null, -- نوع قیمت گذاری Price decimal(19,4) not null ) end