Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ramyasre
Starting Member
16 Posts |
Posted - 2011-05-13 : 08:05:33
|
| Hi, I had a table like as followsname mobileno_______________ree 9954452344yeew 8943234894hkjk 9748445848adsd 7889978784Now i want to add '0' for all mobile no's the output is like asname mobileno_______________ree 09954452344yeew 08943234894hkjk 09748445848adsd 07889978784 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-05-13 : 08:14:40
|
if datatype of mobileno is character (like varchar):selectname,'0' + mobilenofrom table No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-05-13 : 08:15:25
|
What is about mobileno's that have already a leading zero? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
tmaiden
Yak Posting Veteran
86 Posts |
Posted - 2011-05-13 : 10:26:35
|
| SELECT name, '0' + CAST(mobileno AS VARHCAR(10)) AS mobileno |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
akonmask
5 Posts |
Posted - 2011-05-13 : 17:19:28
|
| The sql prefix is used to create a valid XML ID, IDREF, or IDREFS attribute. Also The values of ID type must be distinct in an XML document. |
 |
|
|
|
|
|