IF Not (EXISTS(SELECT * FROM sysobjects WHERE name='IHIOPrescription'))
Begin
CREATE TABLE [dbo].[IHIOPrescription](
	[Id] [UNIQUEIDENTIFIER] NOT NULL DEFAULT (NEWID()),
	[IsPaperPrescription] [BIT] NULL,
	[InsurerCode] [VARCHAR](3) NULL,
	[SamadCode] [NVARCHAR](50) NULL,
	[Status] [TINYINT] NULL DEFAULT ((0)),
	[GenderCode] [TINYINT] NULL DEFAULT ((0)),
	[BirthDate] [DATETIME] NULL,
	[Mobile] [VARCHAR](12) NULL,
	[NationalCode] [VARCHAR](12) NULL,
	[InsuredName] [NVARCHAR](30) NULL,
	[InsuredLastName] [NVARCHAR](50) NULL,
	[DoctorName] [NVARCHAR](30) NULL,
	[DoctorLastName] [NVARCHAR](50) NULL,
	[Medicalid] [INT] NULL,
	[AccountValidTo] [DATETIME] NULL,
	[VisitDate] [DATETIME] NULL,
	[TrackingCode] [INT] NULL,
	[PrintCode] [NVARCHAR](MAX) NULL,
	[SequenceNumber] [SMALLINT] NULL DEFAULT ((0)),
	[CreatedBy] [SMALLINT] NULL,
	[CreatedOn] [DATETIME] NULL DEFAULT (GETDATE()),
 CONSTRAINT [PK_IHIOPrescription] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)
) ON [PRIMARY] 
 
end