I have a table in a SQL Server 2008 database. This table has a nvarchar(256) column called \'Name\'. Unfortunately, the values in this field have extra spaces included. For
SQL Server does not have a TRIM function, but rather it has two. One each for specifically trimming spaces from the "front" of a string (LTRIM) and one for trimming spaces from the "end" of a string (RTRIM).
Something like the following will update every record in your table, trimming all extraneous space (either at the front or the end) of a varchar/nvarchar field:
UPDATE
[YourTableName]
SET
[YourFieldName] = LTRIM(RTRIM([YourFieldName]))
(Strangely, SSIS (Sql Server Integration Services) does have a single TRIM function!)