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 |
|
pacolim
Starting Member
11 Posts |
Posted - 2010-05-06 : 23:43:05
|
| May I know what is the easiet way to convert 123 (numeric) into 0000123 (varchar)in sql server 2005?It can be done in Visual Studio using format fucntion, but this function is not supported in sql serverThank you. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-05-06 : 23:50:49
|
[code]select right(replicate('0', 7) + convert(varchar(10), 123), 7)[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-05-07 : 07:00:50
|
quote: Originally posted by pacolim May I know what is the easiet way to convert 123 (numeric) into 0000123 (varchar)in sql server 2005?It can be done in Visual Studio using format fucntion, but this function is not supported in sql serverThank you.
If you want to show data in .NET, do the formation thereMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|