ITeye博客

清除表,存储过程

wfdoublext · 2010-12-02 17:20 · SQL · 数据库 · Markdown

清除表

--declare @tname varchar(8000)

--set @tname=''

--select @tname=@tname + Name + ',' from sysobjects where xtype='U'

--select @tname='drop table ' + left(@tname,len(@tname)-1)

--exec(@tname).

 

 

--清除存储过程

--declare @procName varchar(500)

--     declare cur cursor

--           for select [name] from sysobjects where type = 'p'

--     open cur

--     fetch next from cur into @procName

--      while @@fetch_status = 0

--     begin

--            if @procName <> 'DeleteAllProcedures'

--                 exec('drop procedure ' + @procName)

--                 fetch next from cur into @procName

--     end

--     close cur

--     deallocate cur

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。