I have a table in SQL Server 2012 that holds a list of parts, location of the parts and the quantity on hand. The problem I have is someone put a space in front of the location when they added it to the database. This allowed there to be two records.
I need to create a job that will find the parts with spaces before the location and add those parts to the identical parts without spaces in front of the location. I'm not quite sure where to even start with this.
This is the before:
Partno | PartRev | Location | OnHand | Identity_Column
--------------------------------------------------------------------
0D6591D 000 MV3 55.000 103939
0D6591D 000 MV3 -55.000 104618
This is what I would like to have after the job ran:
Partno | PartRev | Location | OnHand | Identity_Column
--------------------------------------------------------------------
0D6591D 000 MV3 0 104618