Showing posts with label nvarchar. Show all posts
Showing posts with label nvarchar. Show all posts

Monday, March 12, 2012

removing spaces from an nvarchar column

Hello,
This is a simple question, hopefully with a simple answer. I have
an nvarchar column of length 255. In one of the rows I have the
following sentance - 'See the brown ball bounce'. Is it possible to
use a command to remove all of the spaces in that sentance, so that
the sentance reads 'Seethebrownballbounce'? As you can see, I am not
just interested in getting rid of the trailing and leading spaces.

Thanks,
BillyYou can use REPLACE:

SELECT REPLACE(N'See the brown ball bounce', N' ', N'')

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Billy Cormic" <billy_cormic@.hotmail.com> wrote in message
news:dd2f7565.0411021606.9bbc6d5@.posting.google.co m...
> Hello,
> This is a simple question, hopefully with a simple answer. I have
> an nvarchar column of length 255. In one of the rows I have the
> following sentance - 'See the brown ball bounce'. Is it possible to
> use a command to remove all of the spaces in that sentance, so that
> the sentance reads 'Seethebrownballbounce'? As you can see, I am not
> just interested in getting rid of the trailing and leading spaces.
> Thanks,
> Billy

Saturday, February 25, 2012

Removing decimals from a nvarchar field

I am trying to remove decimals...for example I have values like this:
01.234.678 and I want to update it to 01234678 or 12345678.
Thanks
SELECT REPLACE(column, '.', '') FROM table;
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:B084D109-B3E8-4D0D-B0BC-CC7D836ACA8D@.microsoft.com...
>I am trying to remove decimals...for example I have values like this:
> 01.234.678 and I want to update it to 01234678 or 12345678.
> Thanks

Removing decimals from a nvarchar field

I am trying to remove decimals...for example I have values like this:
01.234.678 and I want to update it to 01234678 or 12345678.
ThanksSELECT REPLACE(column, '.', '') FROM table;
"Gerry M" <GerryM@.discussions.microsoft.com> wrote in message
news:B084D109-B3E8-4D0D-B0BC-CC7D836ACA8D@.microsoft.com...
>I am trying to remove decimals...for example I have values like this:
> 01.234.678 and I want to update it to 01234678 or 12345678.
> Thanks