if Exists(SELECT * FROM information_schema.tables where Table_name = 'ProductFormulDetail') begin print 'true' end else begin --drop table ProductFormulDetail create table ProductFormulDetail ( ID int Primary key Identity(1,1), For_ID int references ProductFormul(ID) not null, Dom_ID_Noe int references Domain (ID) not null, Kal_ID int references Kala(code) , Anb_ID int references Anbar(code), Tedad decimal(19,4), Taf_ID bigint references Tafsili(code), Price decimal (19,4) not null, Sharh nvarchar(300) ) end