Today I need Trim() function in sql, but in Sql 2005 there is no function. Because of that I wrote this user (scalar) fuction. It's very basic; -First; it's Right Trim (RTrim()) string - And then Left Trim (LTrim())
- CREATE FUNCTION dbo.Trim
- @string nvarchar(max)
- RETURNS nvarchar(max)
- RETURN LTRIM(RTRIM(@string))
You need to login to post a comment.