2

I am trying to create a function that removes all the spaces (single or multiple) in a field anywhere in the column. For Example, if a tag = [B00 -PCV 6143-C-], it would get changed to [B00-PCV6143-C-].

Any help would be appreciated.

2 Answers 2

4

Use replace():

select replace(tag, ' ', '') as TagWithNoSpaces 
Sign up to request clarification or add additional context in comments.

Comments

0

You can use REPLACE()

SELECT REPLACE('[B00 -PCV 6143-C-]',' ','') 

REPLACE() - MSDN

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.