
IF NOT EXISTS (SELECT * FROM  SYSOBJECTS
      WHERE SYSOBJECTS.name = 'TSKRSTELEFONTIPI') 

BEGIN

	CREATE TABLE [dbo].[TSKRSTELEFONTIPI](
		[KODU] [int] NOT NULL,
		[ADI] [nvarchar](100) NULL,
		[AKTIF] [bit] NULL,
	 CONSTRAINT [PK_KODU] PRIMARY KEY CLUSTERED 
	(
		[KODU] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY]

END
GO

IF NOT EXISTS (SELECT * FROM [TSKRSTELEFONTIPI] WHERE KODU = 1 AND ADI = 'CEP TELEFONU') 
	INSERT INTO [TSKRSTELEFONTIPI] (KODU,ADI,AKTIF) VALUES(1,'CEP TELEFONU',1)
IF NOT EXISTS (SELECT * FROM [TSKRSTELEFONTIPI] WHERE KODU = 2 AND ADI = 'EV TELEFONU') 
	INSERT INTO [TSKRSTELEFONTIPI] (KODU,ADI,AKTIF) VALUES(2,'EV TELEFONU',1)
IF NOT EXISTS (SELECT * FROM [TSKRSTELEFONTIPI] WHERE KODU = 2 AND ADI = 'İŞ TELEFONU') 
	INSERT INTO [TSKRSTELEFONTIPI] (KODU,ADI,AKTIF) VALUES(2,'İŞ TELEFONU',1)
IF NOT EXISTS (SELECT * FROM [TSKRSTELEFONTIPI] WHERE KODU = 2 AND ADI = 'VELİSİNİN/YAKINININ TELEFONU') 
	INSERT INTO [TSKRSTELEFONTIPI] (KODU,ADI,AKTIF) VALUES(2,'VELİSİNİN/YAKINININ TELEFONU',1)

	

