SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Extracting Multiple names from a field
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bholmstrom
Yak Posting Veteran

USA
75 Posts

Posted - 11/08/2013 :  13:11:36  Show Profile  Reply with Quote
Good afternoon, I have a table that has several fields that contain multiple user names sepearted by a ";". I am trying to extract all of the names into one column so I can then compare it against our active directory.

It would be nice if there was list of names, not duplicated.

Example:

Row 1
Field1 'Mary Beth Underwood'
Field2 'Bryan Flinstone'
Field3 'Mary Beth Underwood;George Test'
Field4 'Hank String'

Row 2
Field1 'Gary Strong'
Field2 'Barney Ted;George Bishop; Hank String'
Field3 'Liz What;Ted Notime'
Field4 'Henry Franks'

What I would like to see is a list like this:

Barney Ted
Bryan Flinstone
Gary Strong
George Bishop
George Test
Hank String
Henry Franks
Liz What
Mary Beth Underwood

Thank you for your always prompt responses

Bryan Holmstrom

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 11/08/2013 :  13:50:10  Show Profile  Reply with Quote
If you scroll to the bottom you will see an answer with multiple way to do this:
http://stackoverflow.com/questions/5722700/how-do-i-split-a-delimited-string-in-sql-server-without-creating-a-function
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000