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.
Author |
Topic |
kirank
Yak Posting Veteran
58 Posts |
Posted - 2013-11-20 : 01:41:14
|
SELECT REPLACE(@ReqType ,'ALL', function call to split(string val, position) ) as [Request Type],From TemptableHere i would create to call the function lets say SplitString with (string , position)and return specific position string from that split resultex: 1. dbo.splitfunction(Menu3_RI_ANCE_2013.docx,2) this will returns RI 2. dbo.splitfunction(Menu3_RI_ANCE_2013.docx,3) this will returns ANCElike that..Thanks for the help. ---------------------------http://codingstuffsbykiran.blogspot.com | http://webdevlopementhelp.blogspot.com |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
kirank
Yak Posting Veteran
58 Posts |
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2013-11-23 : 13:11:21
|
@kirank,I'll recommend that if your string is 8k or less in length, then any splitter that contains any of the following is going to be comparatively slow to using a Tally CTE or Tally Table.WHILE LoopRecursive CTEConcatenation of any typeXML (exception is if you're passing the function XML)With that thought in mind, how long are the strings that you wish to split and get the element number for?--Jeff Moden RBAR is pronounced "ree-bar" and is a "Modenism" for "Row By Agonizing Row".First step towards the paradigm shift of writing Set Based code:"Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column." When writing schedules, keep the following in mind:"If you want it real bad, that's the way you'll likely get it." |
|
|
|
|
|
|
|