If I have a simple table where the data is such that the rows contains strings like:
/abc/123/gyh/tgf/345/6yh/5er
In SQL, how can I select out the data between the 5th and 6th slash? Every row I have is simply data inside front-slashes, and I will only want to select all of the characters between slash 5 and 6.
CLR functions are more efficient in handling strings than T-SQL. Here is some info to get you started on writing a CLR user defined function.
I think you should create the function that has 3 parameters:
Then you split on the delimiter (into an array). Then return the 5th item in the array (index 4)
Here is a t-sql solution, but I really believe that a CLR solution would be better.