if not Exists(SELECT * FROM information_schema.tables where Table_name = 'Follow') begin create table Follow ( ID int primary key, Mat_ID bigint references Matter(ID) not null, FC_ID int references Finance_Cycle(ID) not null, Pro_ID_VahedMali int references OtherProperties(ID) not null, Code int not null, Pro_ID_Region int references OtherProperties(ID) not null, -- منطقه Pro_ID_Guild int references OtherProperties(ID) not null, -- صنف Pro_ID_Identity int references OtherProperties(ID) not null, -- نوع شناسایی TarikhIdentity int not null, -- تاریخ شناسایی Taf_ID_Identity bigint references Tafsili(ID) not null, -- شناسایی کننده Tel1 nvarchar(11) null, Tel2 nvarchar(11) null, Tel3 nvarchar(11) null, Mobile1 nvarchar(11) null, Mobile2 nvarchar(11) null, Mobile3 nvarchar(11) null, CompanyName nvarchar(1000) not null, -- عنوان شرکت/فروشگاه [Address] nvarchar(1000) not null, -- آدرس [Description] nvarchar(max) null, TarikhSabt int not null, SaatSabt smallint not null, CodeKarbar int references Karbar(ID) not null ) end go if not Exists(SELECT * FROM information_schema.tables where Table_name = 'FollowProperty') begin create table FollowProperty ( ID int primary key, Fol_ID int references Follow(ID) not null, Dom_ID_RowType int references domain(ID) not null, [Value] nvarchar(1000) null ) end go if not Exists(SELECT * FROM information_schema.tables where Table_name = 'FollowAction') begin create table FollowAction ( ID int primary key, Fol_ID int references Follow(ID) not null, Tarikh int not null, ExecutionTime int not null, -- زمان صرف شده [Description] nvarchar(max) null, TarikhSabt int not null, SaatSabt smallint not null, CodeKarbar int references Karbar(ID) not null ) end