I have a line as shown below
a_b|c_d
and I need to break it based on | .
So, the result will be:
a_b c_d
Then, I want to split it again into _ , then the result will be:
a b c d
Is it possible to do this in one step? As with entering the appropriate string, it will return a value similar to the following:
a b c d
I created a function for split:
select items from dbo.splitdetails('a_b|c_d','|')
This will lead to:
a_b c_d
But I do not know how I can continue the next split with these results?
Using a temporary table, I hope I can do this, but I need to use it inside the function. Therefore, I believe that a temporary table is not a good option. The cursor is also an option, but when I use the cursor, it will degrade performance because I have thousands of records.
My input:
a_b|c_d
And the desired result:
a b c d
string sql-server sql-server-2008
Arunprasanth kv
source share