Question: I have this column

```
NAME
John Stephenson
James Martin
Anna Corelia

```

How I can select this column to this?

```
NAME
Stephenson, John
Martin, James
Corelia, Anna 

```

Answer: 
```
SELECT substring(NAME+', '+NAME,charindex(' ',NAME)+1,len(NAME)+1) FROM MyTable

```

This also turns `"Rip Van Winkle"` into `"Van Winkle, Rip"`

**[SQL Fiddle Demo](http://sqlfiddle.com/#!3/d4a53/1)**
There is no a single trim function but you can 

```
 select   ltrim(rtrim(colname)) from tablename 

```

which will TRIM both sides.

but what you need is:

```
declare @name varchar(300) ='Stephenson John';
Select  

Substring(@name, 1,Charindex(' ', @name)-1) +
', '  +
Substring(@name, Charindex(' ', @name)+1, LEN(@name))
 as name

```

Sorry I miss post