Simple ,Just Create a Table Design like below:
create table Table1
(
Id int identity(1,1),
user_code as case len(Id) when 1 then 'LE00100'+convert(varchar,ID)
when 2 then 'LE0010'+convert(varchar,ID)
when 2 then 'LE001'+convert(varchar,ID)
else 'LE'+convert(varchar,ID)
end
)
Test:
INSERT INTO Table1 DEFAULT VALUES;
INSERT INTO Table1 DEFAULT VALUES
INSERT INTO Table1 DEFAULT VALUES
INSERT INTO Table1 DEFAULT VALUES
INSERT INTO Table1 DEFAULT VALUES;
select *From Table1