SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 replace
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nord
Posting Yak Master

122 Posts

Posted - 10/28/2013 :  11:27:29  Show Profile  Reply with Quote
Hi,
I would like replace '-' for nothing for example:
514-6544562 to 5146544562
have some ideas?
Thanks

MuMu88
Aged Yak Warrior

547 Posts

Posted - 10/28/2013 :  11:39:32  Show Profile  Reply with Quote


DECLARE @Temp TABLE (ID int, Name VARCHAR(20))

INSERT INTO @Temp VALUES 
(1, '514-6544562'),
(2, '1-2-3-4'),
(3, '2345');

SELECT ID, REPLACE(Name,'-','') FROM @Temp;

Go to Top of Page

nord
Posting Yak Master

122 Posts

Posted - 10/28/2013 :  15:07:43  Show Profile  Reply with Quote
Thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000