if not Exists(SELECT * FROM information_schema.tables where Table_name = 'BargehProperty') begin create table BargehProperty ( ID int primary key Identity(1,1), Bar_ID int references bargeh(ID) not null, Dom_ID_Type int references Domain(ID) not null, Taf_ID bigint references Tafsili(ID), Taf_ID_Atf bigint references Tafsili(ID), Darsad decimal(19,4), Mablagh decimal(19,4), Value nvarchar(1000) ) end go if not Exists(SELECT * FROM information_schema.tables where Table_name = 'BargehDetailProperty') begin create table BargehDetailProperty ( ID int primary key Identity(1,1), BD_ID int references BargehDetail(ID) not null, Dom_ID_Type int references Domain(ID) not null, Taf_ID bigint references Tafsili(ID), Taf_ID_Atf bigint references Tafsili(ID), Darsad decimal(19,4), Mablagh decimal(19,4), Value nvarchar(1000) ) end