if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AMELIYATRANDEVUISTEK]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)


CREATE TABLE [dbo].[AMELIYATRANDEVUISTEK](
	[AMELIYATRANDEVUISTEKID] [int] IDENTITY(1,1) NOT NULL,
	[HDOSYAID] [int] NULL,
	[HMUAYENEID] [int] NULL,
	[HKIMLIKID] [int] NULL,
	[DRID] [int] NULL,
	[RANDEVUTARIHI] [datetime] NULL,
	[RANDEVUSAATI] [nvarchar](5) NULL,
	[RANDEVUSURE] [int] NULL,
	[SALONID] [int] NULL,
	[ACIKLAMA] [nvarchar](500) NULL,
	[SUBEID] [int] NULL,
	[KYTTARIHI] [datetime] NULL,
	[KYTKULLANICI] [nvarchar](20) NULL,
	[ONAYACIKLAMA] [nvarchar](500) NULL,
	[ONAYKULLANICI] [nvarchar](20) NULL,
	[ONAYTARIHI] [datetime] NULL,
	[RANDEVUVERILDI] [bit] NULL,
	[SGTARIHI] [datetime] NULL,
	[SGKULLANICI] [nvarchar](20) NULL,
	[SMSGONDERILDI] [bit] NULL,
	[SMSGONDERIMTARIHI] [datetime] NULL,
	[SMSGONDEREN] [nvarchar](20) NULL,
 CONSTRAINT [PK_AMELIYATRANDEVUISTEK] PRIMARY KEY CLUSTERED 
(
	[AMELIYATRANDEVUISTEKID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
) ON [PRIMARY]
GO

if not exists (select * from dbo.sysobjects where name ='DF_AMELIYATRANDEVUISTEK_RANDEVUVERILDI' and xtype='D')
ALTER TABLE [dbo].[AMELIYATRANDEVUISTEK] ADD  CONSTRAINT [DF_AMELIYATRANDEVUISTEK_RANDEVUVERILDI]  DEFAULT ((0)) FOR [RANDEVUVERILDI]
GO


