SQL update assistance needed
Trying to remove trailing spaces on four lab instruments from various tables and not sure this is the proper syntax. Any help would be greatly appreciated. Thanks
DECLARE
@OldName nvarchar(20);
@NewName nvarchar(20);
BEGIN
SET @OldName := 'PEOptima A ';
SET @NewName := 'PEOptima A';
UPDATE ELM.Instrument SET Instrument=@NewName WHERE Instrument=@OldName;
UPDATE ELM.Batch SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.QCAnalysis SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.Calibration SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.SampleAnalysis SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.InstrumentAnalyte SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.InstrumentElement SET Instrument =