SQL and Database
Showing posts with label
EMP0001
.
Show all posts
Showing posts with label
EMP0001
.
Show all posts
Sunday, 23 December 2012
How to Generate Auto Increment IDs
DECLARE @Increment INT=1
DECLARE @NewProjectCode VARCHAR(100)
WHILE @Increment<100
BEGIN
SET @NewProjectCode='EMP'+ Right('0000'+CAST(@Increment as VARCHAR(4)),4)
PRINT @NewProjectCode
SET @Increment=@Increment+1
END
Older Posts
Home
Subscribe to:
Posts (Atom)