asranantha
SSCarpal Tunnel
Points: 4246
More actions
January 9, 2013 at 1:42 am
#272542
hi friens i have small doubt in sql server.plese tell me how to solve this issuse.
table data contains like
id
10
12
9
15
8
4
100
29
i want output like
010
012
009
015
008
004
029
.plese tell me how to write query in sql server
Jason-299789
SSC-Insane
Points: 21601
January 9, 2013 at 1:49 am
#1575098
This should work, there are other ways as well
CREATE TABLE #Id
(
Id int
)
Insert into #Id
Values (10),(12),(9),(15),(8),(4),(100),(29)
Select Id,Right('000'+Convert(varchar,Id),3) from #Id
_________________________________________________________________________SSC Guide to Posting and Best Practices
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply