SQL and Database
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
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment