I think you actually just need to move the first word to the end (code to figure out multi-word last names / suffixes is much more complex and would require lots of additional code no matter what approach you took).
SELECT DP.OwnerName AS OwnerName_Original,
SUBSTRING( DP.OwnerName, alias1.FirstSpaceInOwnerName, 1000) + ' ' +
LEFT(DP.OwnerName, alias1.FirstSpaceInOwnerName - 1)
FROM ( --dbo.tblDataParcel DP
VALUES('Smith John H'),('Smith John'),('OneNameOnly')
) AS DP(OwnerName)
CROSS APPLY (
SELECT CHARINDEX(' ', DP.OwnerName + ' ') AS FirstSpaceInOwnerName
) AS alias1
If this is one time - then what are you going to do next month after the users have entered more data? There are several approaches you can take without modifying the application, but it will depend on why you need to change the data.
drop table #abc
go
create table #abc
(
col varchar(100)
)
go
insert into #abc select 'Smith John '
go
select * from #abc
go
SQL ..
;WITH rec_cte
AS (SELECT Cast(Stuff(b.col, Patindex('%[^a-z]%', b.col), 10, ' ') AS
VARCHAR) AS
ABC,
Substring(b.col, Len(Stuff(b.col, Patindex('%[^a-z]%', b.col),
10,
' '))
+ 2, 10)
AS
OK
FROM #abc b
UNION ALL
SELECT Cast(Stuff(rec_cte.ok, Patindex('%[^a-z]%', rec_cte.ok), 10, ' '
) AS
VARCHAR) AS
ABC,
Substring(rec_cte.ok, Len(Stuff(rec_cte.ok, Patindex('%[^a-z]%',
rec_cte.ok), 10
, ' '))
+ 2, 10)
AS OK
FROM rec_cte
WHERE Len(rec_cte.ok) > 0),
cte_final
AS (SELECT abc,
Stuff((SELECT ' ' + abc
FROM rec_cte
ORDER BY abc
FOR xml path(''), type).value('.', 'varchar(max)'), 1, 1,
'')
AS
name_reverse
FROM rec_cte
GROUP BY abc)
SELECT DISTINCT name_reverse
FROM cte_final