create table t1(id int,name varchar(50))
insert into t1 values(1,'aaa')
select * from t1
drop table #temp
select * into #temp From t1
truncate table t1
alter table t1 drop column id
alter table t1 add id int identity(1,1)
insert into t1(name)
select NAME from #temp
select * from #tempSuppose you have create table t1 by mistake id in int but now there are hundred of data and your requirement is to change in identity than this is the bast example of use temp table.This code for use of Temp Table.
