use a computed column to format the zero padding
create table #table
(
id int identity(1,1),
key_id as right('00000' + convert(varchar(5), id), 5),
col int
)
insert into #table (col)
select 10
select * from #table
/*
id key_id col
----------- ---------- -----------
1 00001 10
*/
KH