IF OBJECT_ID(N'[dbo].[Hr_T_VehicleMovement]', 'U') IS NULL BEGIN CREATE TABLE [dbo].[Hr_T_VehicleMovement] ( [Id] uniqueidentifier NOT NULL DEFAULT NEWID(), [TenantId] uniqueidentifier NULL, [MovementNo] int NOT NULL DEFAULT 0, [VehicleId] uniqueidentifier NOT NULL, [BranchId] uniqueidentifier NULL, [ExitDate] date NOT NULL, [ExitTime] nvarchar(5) NOT NULL, [ExitKm] int NOT NULL, [SenderUserId] uniqueidentifier NULL, [SecurityUserId] uniqueidentifier NULL, [DriverUserId] uniqueidentifier NOT NULL, [DestinationId] uniqueidentifier NULL, [Reason] nvarchar(MAX) NULL, [Location] nvarchar(128) NULL, [EntrySecurityUserId] uniqueidentifier NULL, [EntryBranchId] uniqueidentifier NULL, [EntryDate] date NULL, [EntryTime] nvarchar(5) NULL, [EntryKm] int NULL, [TravelledKm] int NULL, [Status] nvarchar(16) NOT NULL DEFAULT 'Left', [DurationMinutes] int NULL, [ExpectedKm] int NULL, [CreationTime] datetime2 NOT NULL DEFAULT GETUTCDATE(), [CreatorId] uniqueidentifier NULL, [LastModificationTime] datetime2 NULL, [LastModifierId] uniqueidentifier NULL, [IsDeleted] bit NOT NULL DEFAULT 0, [DeletionTime] datetime2 NULL, [DeleterId] uniqueidentifier NULL, CONSTRAINT [PK_Hr_T_VehicleMovement] PRIMARY KEY NONCLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO