Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Split field into two...

Author  Topic 

mjhjason
Starting Member

6 Posts

Posted - 2011-03-24 : 20:03:06
Okay, this is just something I'm looking to do, but unsure how to begin...

Take this string from field1, turn into a split array or Expr2... (or similiar)

Preferably in a select statement... (no join or table function)

This string:
PlaintiffLast, PlaintiffFirst & DefendantLast, DefendantFirst 00-12345-DM

Into two fields like:
Field1: plaintifflast, plaintifffirst
Field2: defendantlast, defendantfirst

Any help would be great. I'm goin nuts, unsure what method I'd use..

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-03-24 : 20:12:00
This http://www.sommarskog.se/arrays-in-sql-2005.html#CSV page discusses various approaches, the pluses and minuses, with and without iteration, with and without table of numbers etc. There are examples too.
Go to Top of Page
   

- Advertisement -