May 20, 2008 at 12:34 am
Hi,
Can I replacea a range of letters or numbers from a string?
For example
I want to replace the string 'sdekwexnm123486' with
'000000000123486'
How can I do it?
Please help me out.
May 20, 2008 at 12:38 am
Look up the REPLACE function in books online.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 20, 2008 at 6:19 am
sunandas (5/20/2008)
Hi,Can I replacea a range of letters or numbers from a string?
For example
I want to replace the string 'sdekwexnm123486' with
'000000000123486'
How can I do it?
Please help me out.
CREATE TABLE #Temp
(MyColumn VARCHAR(50))
GO
INSERT INTO #Temp
VALUES('MyReplaceMentsdekwexnm123486')
GO
SELECT REPLACE(MyColumn,'sdekwexnm123486','000000000123486') FROM #Temp
GO
DROP TABLE #Temp
GO
Prasad Bhogadi
www.inforaise.com
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy