Split string with delimiter in sql server

Posted by Renju on Stack Overflow See other posts from Stack Overflow or by Renju
Published on 2010-04-09T13:03:05Z Indexed on 2010/04/09 13:33 UTC
Read the original article Hit count: 220

Filed under:

I'm having a coloumn name with varchar field that holds some folder path like "C:\Program Files\Internet Explorer\en-US" .I need to update the root folder name(Program files to profilesNew).Can anyone please help. I tried with a query

declare @val as varchar(100)
set @val='C:\Program Files\Internet Explorer\en-US'

select substring(@val,charindex(':\',@val),charindex('\',@val))

but not getting the exact answer

C:\Program FilesNew\Internet Explorer\en-US

© Stack Overflow or respective owner

Related posts about sql-server