if not Exists(SELECT * FROM information_schema.tables where Table_name = 'Company') begin Create table Company ( ID int primary key, Code nvarchar(100), Title nvarchar(1000), -- عنوان فارسی Name nvarchar(1000), -- نام لاتین Dom_ID_ContractorType int references Domain (ID) not null, -- نوع پیمانکار => حقیقی|حقوقی Dom_ID_ResponsibilityType int references Domain (ID) null, -- نوع مسئولیت => سهامی عام|سهامی خاص| مسئولیت محدود Dom_ID_Status int references Domain (ID) not null, -- وضعیت => فعال | غیرفعال Peo_ID_Manager int references People(ID) not null, -- مدیر عامل NationalCode nvarchar(100), -- شناسه ملی EconomicCode nvarchar(100), -- کد اقتصادی RegistrationNumber nvarchar(100), -- شماره ثبت PostalCode nvarchar(100), -- کد پستی Pro_ID_ActivityType int references OtherProperties(ID) null, -- زمینه فعالیت Pro_ID_Rank int references OtherProperties(ID) null, -- رتبه شرکت Pro_ID_City int references OtherProperties(ID) null, -- شهر [Address] nvarchar(1000), Fax nvarchar(100), Phone nvarchar(100), Mobile nvarchar(100), Email nvarchar(100), WebSite nvarchar(100), [Description] nvarchar(1000), Taf_ID bigint references Tafsili(ID) null, -- کد تفصیلی Mat_ID bigint references Matter(ID) not null, -- جهت لاگ CodeKarbar int references karbar(ID) not null, TarikhSabt int not null, SaatSabt smallint not null, ) end