if NOT Exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[HIX_Prescriptions]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
Begin
CREATE TABLE [dbo].[HIX_Prescriptions](
	[ItemId] [NUMERIC](18, 0) IDENTITY(1,1) NOT NULL,
	[PrescriptionId] [NUMERIC](18, 0) NULL,
	[Status] [TINYINT] NULL,
	[InsertDate] [DATETIME] NULL,
	[ResultDate] [DATETIME] NULL,
	[ExceptionCode] [NVARCHAR](200) NULL,
	[ExceptionMessage] [NVARCHAR](200) NULL,
	[ExceptionStacktrace] [NVARCHAR](200) NULL,
	[PayloadClass] [NVARCHAR](200) NULL,
	[Type] [INT] NULL,
	[ConversationId] [NVARCHAR](200) NULL,
	[Id] [NVARCHAR](200) NULL,
 CONSTRAINT [Pk_HIX_Prescriptions] PRIMARY KEY CLUSTERED 
(
	[ItemId] 
)
) ON [PRIMARY]
ALTER TABLE [dbo].[HIX_Prescriptions] ADD  CONSTRAINT [DF_HIX_Prescriptions_InsertDate]  DEFAULT (GETDATE()) FOR [InsertDate]
End
