Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Tricky String Operation

$
0
0

I just need the second form of the name like "John Smith" or the name itself like "Jane Davis":

DECLARE @Name TABLE (ID INT IDENTITY(1,1) PRIMARY KEY, Name nvarchar(256))

INSERT @Name(Name) SELECT N'Boccaccio, GiovanniGiovanni Boccaccio';
INSERT @Name(Name) SELECT 'Smith, JohnJohn Smith';
INSERT @Name(Name) SELECT 'Miller, Samuel BodeSamuel Bode Miller';
INSERT @Name(Name) SELECT 'Jane Davis';



The name string as is without separator.

Thanks.


Kalman Toth Database & OLAP Architect SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012







Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>