|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL Server and Split functionI 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. Show quote "Indy" <w**@www.com> wrote in message news:d29ilr$km9$1@bagan.srce.hr... > 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 > > Indy wrote:
> I wish to create a procedue (in SQL Server) that takes one long http://www.devx.com/tips/Tip/20009> 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 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. -- Chris Priede (pri***@panix.com) Hi,
Do you need to pass some sort of array of values? If yes, then check my KB article about how to do this with the SQL Server SP http://support.microsoft.com/default.aspx?scid=kb;en-us;555266 Show quote "Indy" <w**@www.com> wrote in message news:d29ilr$km9$1@bagan.srce.hr... >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 > |
|||||||||||||||||||||||