if Exists(SELECT * FROM information_schema.tables where Table_name = 'Errors') begin print 'true' end else begin create table Errors ( Code int primary key identity(1,1), NameError nvarchar(100), SharhError nvarchar(2000), TarikhError int, SaatError int, CodeKarbar int foreign key references karbar(code) ) end