摘要: DECLARE @Sp_Name varchar(30) --定义游标操作DECLARE @Tb_Count intSET @Tb_Count = 0DECLARE staff_cursor CURSOR FOR SELECT [name] FROM sys.sysobjects WHERE type='p' AND Category =0 --Category =0 表示 -- 打开游标OPEN staff_cursor -- 提取记录数据FETCH Next FROM staff_cursor Into @Sp_Name PRINT '开始删除存储过程' W 阅读全文
posted @ 2012-03-04 18:34 KynoLee 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 具体方法如下:DECLARE @Tb_Name varchar(30) --定义游标操作DECLARE staff_cursor CURSOR FOR SELECT [name] FROM sys.sysobjects WHERE type='U' -- 打开游标OPEN staff_cursor -- 提取记录数据FETCH Next FROM staff_cursor Into @Tb_Name WHILE @@fetch_status = 0 BEGIN EXEC('DROP TABLE ' + @Tb_Name ) PRINT @Tb_Name FETC 阅读全文
posted @ 2012-03-04 18:33 KynoLee 阅读(513) 评论(0) 推荐(1) 编辑