IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSOBJECTS.name = 'TASMEDDOSYATUR')

CREATE TABLE [dbo].[TASMEDDOSYATUR](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[DocTypeId] [nvarchar](50) NULL,
	[DOKUMANTIPI] [nvarchar](100) NULL,
	[DOKUMANXMLETIKETI] [nvarchar](100) NULL,
	[FR3_AYAKTAN] [nvarchar](250) NULL,
	[FR3_YATARAK] [nvarchar](250) NULL,
	[FR3_GUNUBIRLIK] [nvarchar](250) NULL,
	[AKTIF] [bit] NOT NULL,
	[SUBEID] [int] NULL,
 CONSTRAINT [PK_TASMEDDOSYATUR_1] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

IF NOT EXISTS (SELECT * FROM sys.all_objects  WHERE name = 'DF_TASMEDDOSYATUR_AKTIF')
ALTER TABLE [dbo].[TASMEDDOSYATUR] ADD  CONSTRAINT [DF_TASMEDDOSYATUR_AKTIF]  DEFAULT ((1)) FOR [AKTIF]
GO
