There are only LTRIM and RTRIM functions in T-SQL
But I want to trim both side.
How can I do?Use both :)
SELECT LTRIM(RTRIM(' this is a string with whitespace on both sides ')
--
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:uyfpTXTfGHA.4828@.TK2MSFTNGP05.phx.gbl...
> There are only LTRIM and RTRIM functions in T-SQL
> But I want to trim both side.
> How can I do?
>
Showing posts with label ltrim. Show all posts
Showing posts with label ltrim. Show all posts
Friday, March 30, 2012
How to trim both side?
There are only LTRIM and RTRIM functions in T-SQL
But I want to trim both side.
How can I do?Use both
SELECT LTRIM(RTRIM(' this is a string with whitespace on both sides ')
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:uyfpTXTfGHA.4828@.TK2MSFTNGP05.phx.gbl...
> There are only LTRIM and RTRIM functions in T-SQL
> But I want to trim both side.
> How can I do?
>
But I want to trim both side.
How can I do?Use both

SELECT LTRIM(RTRIM(' this is a string with whitespace on both sides ')
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:uyfpTXTfGHA.4828@.TK2MSFTNGP05.phx.gbl...
> There are only LTRIM and RTRIM functions in T-SQL
> But I want to trim both side.
> How can I do?
>
Subscribe to:
Posts (Atom)