--/第1步**********删除所有表的外键约束*************************/ DECLARE c1 cursor for select 'alter table ['+ object_name(parent_obj) + '] drop constraint ['+name+']; ' from sysobjects where xtype = 'F' open c1 ) fetch next from c1 into @c1 ) begin exec(@c1) fe…
declare proccur cursor for select [name] from sysobjects where type='P' declare @procname varchar() open proccur fetch next from proccur into @procname ) begin --exec('drop proc ' + @procname) --本句被注释,使用时请取消 print(@procname + '…
--删除整个表数据 SET STATISTICS TIME ON; DECLARE @Timer DATETIME = GETDATE(); TRUNCATE TABLE LOG_DEBUG_ERROR ; SELECT DATEDIFF(MS, @Timer, GETDATE()) AS [执行时间(毫秒)]; SET STATISTICS TIME OFF; select * from SYS_PERFORMANCE 不可以添加where 删除后自增id从1开始…