IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSCOLUMNS.NAME = 'ID' AND SYSOBJECTS.name = 'TMDLOZELDURUM')
ALTER TABLE TMDLOZELDURUM ADD ID int NOT NULL IDENTITY (1, 1)
GO 

if exists (select * from dbo.sysobjects where id = object_id(N'PK_TMDLOZELDURUM') and xtype in (N'PK'))
BEGIN
 ALTER TABLE TMDLOZELDURUM
  DROP CONSTRAINT PK_TMDLOZELDURUM
END

GO 
 IF NOT EXISTS(SELECT TOP 1 * FROM TMDLOZELDURUM WHERE CAST(MDLOZELDURUMKOD as binary) = CAST('j' as binary))
 INSERT INTO TMDLOZELDURUM (MDLOZELDURUMKOD,MDLOZELDURUM,AKTIF,PASIFTARIHI) VALUES('j','Covid-19 (SARS-Cov-2) Reserve Transkriptaz PCR dışardan temin',1,'')
GO

IF not EXISTS(select * from dbo.sysobjects where id = object_id(N'PK_TMDLOZELDURUM') and xtype in (N'PK'))
ALTER TABLE dbo.TMDLOZELDURUM ADD CONSTRAINT
	PK_TMDLOZELDURUM PRIMARY KEY CLUSTERED 
	(
	ID
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO