You can use the Charindex() and the Substring() to do what you need.
First we must find the delimiting character, in your case the comma.
After that we will get what comes before and after the comma, this way:
select
Substring(nome, Charindex(',', nome)+1, LEN(nome)) as Nome,
Substring(nome, 1,Charindex(',', nome)-1) as LastName,
from Pessoas
Now, for what you need, just concatenate the two, getting like this:
select
Substring(nome, Charindex(',', nome)+1, LEN(nome)) + ' ' + Substring(nome, 1,Charindex(',', nome)-1) as Nome
from pessoas
At this Link has a small tutorial of the functions.
Which database you are using?
– Filipe Moraes
The ideal is to receive the value of the form it is and then do the treatment by reversing the values.
– Viniam
I am using sql server express
– usersantos
If the persistence of the data is in a single field, you will have to build a function to correct the database entry.
– Luiz Vichiatto
yes it is a single field
– usersantos