SQL Server and Split function

  • Thread starter Thread starter Indy
  • Start date Start date
I

Indy

I wish to create a procedue (in SQL Server) that takes one long string -
i.e. 25 names that are separated with a '#'. In C# I use Split function to
get 25 different strings from that one, but I don't know how to do it in SQL
Server
Thx
 
I once used Patindex and a cursor to do something very similar similar. If
you want I can e-mail you the code as it is lengthy and wouldn't format via
a news post well anyhow.
 
Indy said:
I wish to create a procedue (in SQL Server) that takes one long
string - i.e. 25 names that are separated with a '#'. In C# I use
Split function to get 25 different strings from that one, but I don't
know how to do it in SQL Server

http://www.devx.com/tips/Tip/20009

It would be better if you didn't have to, though. If possible, reconsider
your database design and don't store it (whatever it is) that way. Chances
are it is a good candidate for either related rows in a separate table or
individual columns for each value.
 
Back
Top