IF NOT (EXISTS
(
    SELECT *
    FROM sysobjects
    WHERE name = 'IHIOSavedPrescription'
)
       )
BEGIN

    CREATE TABLE [dbo].[IHIOSavedPrescription]
    (
        [Id] [UNIQUEIDENTIFIER] NOT NULL,
        [TrackingCode] [NVARCHAR](MAX) NULL,
        [SamadCode] [NVARCHAR](MAX) NULL,
        [NationalCode] [VARCHAR](12) NULL,
        [MedicalId] [INT] NULL,
        [Mobile] [VARCHAR](12) NULL,
        [CreatedBy] [SMALLINT] NULL,
        [CreatedOn] [DATETIME] NULL,
        CONSTRAINT [PK_IHIOSavedPrescription]
            PRIMARY KEY CLUSTERED ([Id] ASC)
    ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];

    ALTER TABLE [dbo].[IHIOSavedPrescription]
    ADD CONSTRAINT [DF_IHIOSavedPrescription_Id]
        DEFAULT (NEWID()) FOR [Id];

END;


