34,593
社区成员
发帖
与我相关
我的任务
分享
生成语句执行就行了。。
select
'delete '+quotename(Name)+char(10)+
case when exists(select 1 from syscolumns where ID=a.ID and status=0x80 )
then ' DBCC CHECKIDENT ('+quotename(Name,'''')+', RESEED, 0)' else '' end --有自增列时重置种子
from
sysobjects a
where
xtype='U' and Name<>'dtproperties'