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 |
|
kvishnuprasad
Starting Member
13 Posts |
Posted - 2008-06-25 : 12:21:19
|
| I have a table with a column name RequestId which is a character and length of 15.I have loaded 40000 records into it adn i can see them in the following formatRequestID122364465 ...etcNow i need to convert the request id in the following way.RequestID000000000000001000000000000002000000000000023000000000000064000000000000465ALL i want to do is append zeros infront of the number (15digits) |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-06-25 : 12:25:41
|
| Hi,try this and make it fitting to your problem:select right('000000000000000'+RequestID,15)GreetingsWebfred |
 |
|
|
kvishnuprasad
Starting Member
13 Posts |
Posted - 2008-06-25 : 13:03:26
|
| Thank you fred that works !!!!!!! you are my savior!!!!!!!!!!!! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-25 : 13:06:07
|
quote: Originally posted by kvishnuprasad Thank you fred that works !!!!!!! you are my savior!!!!!!!!!!!!
Note that if you want to show formatted data in front end application, do formation thereMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|