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
 General SQL Server Forums
 New to SQL Server Programming
 add '+' sign in front
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

peace
Constraint Violating Yak Guru

278 Posts

Posted - 06/20/2012 :  02:45:00  Show Profile  Reply with Quote
how can i add in '+' infront of the mobile number?

i have a list of mobile number that need to add '+' in the front.

some already has the '+' sign infront. just need to update those who dont have yet.

mobileNo
60812321312
60812321311
60812312333
+60812345345
+60823542357

khtan
In (Som, Ni, Yak)

Singapore
16746 Posts

Posted - 06/20/2012 :  02:59:08  Show Profile  Reply with Quote

update  t
set     mobile = '+' + mobile
from    tbl t
where   mobile not like '+%'



KH
Time is always against us

Go to Top of Page

vinu.vijayan
Posting Yak Master

India
227 Posts

Posted - 06/20/2012 :  06:38:26  Show Profile  Reply with Quote
quote:
Originally posted by khtan


update  t
set     mobile = '+' + mobile
from    tbl t
where   mobile not like '+%'



KH
Time is always against us





Very Nice one Khtan.
I did it with a Substring Condition to check the '+'.

But yours is way more simple than that.

Its just one of those days/times when only the harder solution comes to your mind......too much work I guess.

N 28° 33' 11.93148"
E 77° 14' 33.66384"
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