It's me again, Margaret.
Is there an equivalent function to TRIM() (from vbScript) in SQL Server?
What it does is takes a string and trims off any leading or trailing spaces in the variable --
i.e. I have some data that was imported from (ACK!) Excel, and when it came in, SQL Server set it up as an nvarchar data type, and so I have all this trailing whitespace on my data --
I went in and changed it to varchar, but it left the spaces in, I guess because it just felt bad truncating my data --
What I would like to say is:
UPDATE tableName SET columnName = TRIM(columnName)
but, of course, SQL Server doesn't seem to like that word.
Thanks!
Paul Prewett
Is there an equivalent function to TRIM() (from vbScript) in SQL Server?
What it does is takes a string and trims off any leading or trailing spaces in the variable --
i.e. I have some data that was imported from (ACK!) Excel, and when it came in, SQL Server set it up as an nvarchar data type, and so I have all this trailing whitespace on my data --
I went in and changed it to varchar, but it left the spaces in, I guess because it just felt bad truncating my data --
What I would like to say is:
UPDATE tableName SET columnName = TRIM(columnName)
but, of course, SQL Server doesn't seem to like that word.
Thanks!
Paul Prewett