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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Split a space-separated string into parts

Author  Topic 

crazycat503
Starting Member

16 Posts

Posted - 2012-05-02 : 07:27:33
Is there a function that splits a string by space, like we have in vb.net or so? I cant find to find one

All guys!

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-05-02 : 08:10:36
There is a PARSENAME function which may be of limited use (which I personally don't like very much). Other than that, there is nothing built in, but there are several available if you google for it. One I particularly like is here: http://www.sqlservercentral.com/articles/Tally+Table/72993/ It is a UDF (in Fig. 21) which you can copy, install on your server and use.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-02 : 19:42:09
this is what i created for parsing string on any delimiter

http://visakhm.blogspot.com/2010/02/parsing-delimited-string.html



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -