skip to main
|
skip to sidebar
Monday, December 14, 2009
How to format auto id number to 0000001 in Sql Server?
declare @num int
declare @fixed_size int
set @fixed_size = 10
set @num = 40
SELECT @num as [orig], RIGHT(REPLICATE('0',@fixed_size) + CAST(@num AS varchar(10)),@fixed_size) As [modif]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Translation
Subscribe via email
Enter your email address:
Kannabiran [Author]
Categories
AJAX
(4)
ASP.Net
(10)
C#.Net
(47)
CSS
(2)
Directory
(3)
General
(1)
HTML
(2)
IIS
(3)
Infragistics
(1)
JavaScript
(21)
Oracle
(2)
Q n A ASP.Net
(1)
Q n A OOPS
(1)
Q n A SQL Server
(5)
Registry
(2)
SQL Server
(41)
VB.Net
(11)
Web Config
(5)
Window Service
(3)
About Me
Kannabiran
View my complete profile
Some of my Frenz...
No comments:
Post a Comment