I'm attempting to remove leading and trailing spaces from an NVARCHAR(MAX) column that contains price information (using NVARCHAR due to data importing from multiple operating systems with odd characters).
The leading and following spaces from static prices can now be removed using a t-SQL statement. I'm at a loss for how to use this identical command to eliminate all pricing, though.
The static script I used to eliminate particular pricing is shown here:
UPDATE *tablename* set *columnname* = LTRIM(RTRIM(2.50)) WHERE cost = '2.50 ';
Here's what I've tried to remove all the trailing spaces:
UPDATE *tablename* set *columnname* LIKE LTRIM(RTRIM('[.]')) WHERE cost LIKE '[.] ';
I've also experimented with various the% for random character variations, but I'm currently at a loss for ideas.
I want to remove all the leading and following spaces from each cell in this column with just one straightforward command, without changing any of the column data itself.