IF NOT (EXISTS(SELECT name FROM sysobjects WHERE name = 'TrackingPrescription'))
Begin
CREATE TABLE [dbo].[TrackingPrescription](
	[Id] [UNIQUEIDENTIFIER] NOT NULL,
	[prescriptionId] [UNIQUEIDENTIFIER] NOT NULL,
	[userId] SMALLINT NOT NULL,
	[CreatedOn] [DATETIME] NOT NULL,
	[Status] [TINYINT] NOT NULL,
	[StationNo] TINYINT NOT NULL,
 CONSTRAINT [PK_TrackingPriciption] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)
) ON [PRIMARY]
ALTER TABLE [dbo].[Trackingprescription] ADD  CONSTRAINT [DF_Trackingprescription_Id]  DEFAULT (NEWID()) FOR [Id]
ALTER TABLE [dbo].[Trackingprescription] ADD  CONSTRAINT [DF_Trackingprescription_Status]  DEFAULT ((0)) FOR [Status]
ALTER TABLE [dbo].[Trackingprescription] ADD  CONSTRAINT [DF_Trackingprescription_StationNo]  DEFAULT ((0)) FOR [StationNo]
ALTER TABLE [dbo].[Trackingprescription] ADD  CONSTRAINT [DF_Trackingprescription_TrackingDate]  DEFAULT (getdate()) FOR [CreatedOn]
End
