快速刪除DiscuzNT論壇資料表和儲存過程

2022-09-21 17:51:08 字數 1666 閱讀 9531

本來想乙個乙個刪除的,開啟資料庫一看那麼多的表和儲存過程,就放棄這種笨辦法了,於是決定用sql語句來搞定。**如下:

複製**

**如下:

-----------------------------刪除資料表---------------------

declare @au_lname varchar(40),@sqlstring nvarchar(500)

declare tb cursor for

select name from sysobjects ojjdylxkwhere xtype='u' and name like 'dnt%'

open tb

-- perform the first fetch.

fetch next from tb into @au_lname

-- check @@fetch_status to see if there are any more rows to fetch.

while @@fetch_status = 0

begin

-- this is executed as long as the previous fetch succeeds.

fetch next from tb into @au_lname

set @sqlstring='drop table '+ @au_lname

exec sp_executesql @sqlstring

--drop table @au_lname

end

close tb

deallocate tb

go -----------------------------刪除儲存過程---------------------

declare @au_lname varchar(40),@sqlstring nvarchar(500)

declare tb cursor for

select name from sysobjects where xtype='p' and name like 'dnt%'

open tb

-- perform the first fetch.

fetch next from tb into @au_lname

-- check @@fetch_status to swww.cppcns.comee if there are any more rows to fetch.

while @@fetch_status = 0

begin

-- this is executed as long as the previous fetch succeeds.

fetch next from tb into @au_lname

set @sqlstring='drop procedure '+ @au_lname

exec sp_executesql @sqlstring

--drop table @au_lname

end

close 程式設計客棧tb

deallocate tb

go

本文標題: 快速刪除discuznt論壇資料表和儲存過程

本文位址: /cms/discuz/9017.html

C 自動登入DiscuzNT論壇並發帖

using system using system.collections.generic using system.componentmodel using system.data using system.drawing using system.linq using system.text u...

快速搭建 Discuz 論壇

1 準備 lamp 環境 lamp 是 linux apache mysql 和 php 的縮寫,是 discuz 論壇系統依賴的基礎執行環境。我們先來準備 lamp 環境,系統為centos 6.8 x86 64 1.1 安裝 mysql 使用 yum 安裝 mysql 1 yuminstallm...

快速刪除node modules

解決方法 使用npm的乙個名為rimraf的模組進行刪除 官方描述 the unix commandrm rffor node,即node環境下模擬unix或者linux下的rm rf 強制刪除命令 使用 cd the folder which includes node modules folde...