﻿DECLARE @CurrentVehicleId nvarchar(6);
DECLARE @NewVehicleId nvarchar(6);
SET @CurrentVehicleId = '#';
SET @NewVehicleId = '#';

ALTER TABLE [dbo].[Log] NOCHECK CONSTRAINT Vehicle_Logs

UPDATE [Vehicle]
SET VehicleId = @NewVehicleId
WHERE VehicleId = @CurrentVehicleId

UPDATE [Log]
SET Vehicle_VehicleId = @NewVehicleId
WHERE Vehicle_VehicleId = @CurrentVehicleId

ALTER TABLE [dbo].[Log] WITH CHECK CHECK CONSTRAINT Vehicle_Logs
