复制整张表
select * into NewTableName from OldTableName
只复制列名而不要内容
select * into NewTableName from OldTableName where 1=0
表间数据复制
insert into Table1(zt) select titile from Table2
用SQL语句更改自动编号的字段重新重'1'开始编号
example
cloth4(cid,clcode,cloth) cid字段为identity(int,1,1) 重建cid
select * into #aa from cloth4 truncate table cloth4 dbcc checkident(cloth4,reseed,0)
set IDENTITY_INSERT ON insert cloth4(clcode,clname) select clcode,clname from #aa
//注意不能选择cid列
drop table #aa