开发者

SplitValue function in sql server2008

I found some table valued function for splitting string in sp and getting values in columns, but when data is huge these functions are became slow. so if anybody has a good function for splitting values separated by commas into rows of a table... please provide me.

The link where I found some fu开发者_开发问答nctions: Click Here


I use Erland Sommarskog's chunk_split_me function. I doubt you will find any articles which go in to more depth regarding the relative performance merits of each approach to the problem.

If none of his functions work for you then you'll probably need to look to batch processing.


It takes a long time to process precisely BECAUSE there is a lot of data. You aren't going to escape that.

The problem is that you are storing multiple values in a single column. This violates First Normal Form. As a result, you cannot create indexes on these columns to search them more efficiently.

I suggest you improve your design to split the comma text into separate columns. You can copy your data to the new improved design using a query like the one you've already written.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜