-2

I want to split a column string

This is the string :

  Final Settlement Of Security Fee /BTS-15-0114/SYED AKHNOKH HUSSAIN

I want to split on the bases of '/', i want this result :

   Final Settlement Of Security Fee 
   BTS-15-0114
   SYED AKHNOKH HUSSAIN

and i want to get the middle string 'BTS-15-0114'

  • 1
    [Start here](https://www.google.co.il/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=split+string+based+on+a+delimeter+in+sql+server+2008) – Zohar Peled Feb 21 '17 at 13:48

1 Answers1

0

Does all the values is same format like you posted? Here is a sample for your sample string.

DECLARE @s VARCHAR(max)='Final Settlement Of Security Fee /BTS-15-0114/SYED AKHNOKH HUSSAIN'
SELECT PARSENAME( REPLACE(@s,'/','.'),2)

WIll get:

BTS-15-0114

Nolan Shang
  • 2,312
  • 1
  • 14
  • 10