刪除與恢復擴充套件儲存過程

2021-04-18 11:14:24 字數 3662 閱讀 1449

命令刪除sql的擴充套件

use master exec sp_dropextendedproc 'xp_cmdshell' exec sp_dropextendedproc 'xp_dirtree' exec sp_dropextendedproc 'xp_enumgroups' exec sp_dropextendedproc 'xp_fixeddrives' exec sp_dropextendedproc 'xp_loginconfig' exec sp_dropextendedproc 'xp_enumerrorlogs' exec sp_dropextendedproc 'xp_getfiledetails' exec sp_dropextendedproc 'sp_oacreate' exec sp_dropextendedproc 'sp_oadestroy' exec sp_dropextendedproc 'sp_oageterrorinfo' exec sp_dropextendedproc 'sp_oagetproperty' exec sp_dropextendedproc 'sp_oamethod' exec sp_dropextendedproc 'sp_oasetproperty' exec sp_dropextendedproc 'sp_oastop' exec sp_dropextendedproc 'xp_regaddmultistring' exec sp_dropextendedproc 'xp_regdeletekey' exec sp_dropextendedproc 'xp_regdelete' exec sp_dropextendedproc 'xp_regenums' exec sp_dropextendedproc 'xp_regread' exec sp_dropextendedproc 'xp_regremovemultistring' exec sp_dropextendedproc 'xp_regwrite' drop procedure sp_makewebtask go

恢復擴充套件儲存過程,執行以下語句。至於sp_makewebtask 這個儲存過程你可以從別人那拷貝過來乙個指令碼,執行以後生成的儲存過程一樣可以用。

use master exec sp_addextendedproc xp_cmdshell,'xp_cmdshell.dll' exec sp_addextendedproc xp_dirtree,'xpstar.dll' exec sp_addextendedproc xp_enumgroups,'xplog70.dll' exec sp_addextendedproc xp_fixeddrives,'xpstar.dll' exec sp_addextendedproc xp_loginconfig,'xplog70.dll' exec sp_addextendedproc xp_enumerrorlogs,'xpstar.dll' exec sp_addextendedproc xp_getfiledetails,'xpstar.dll' exec sp_addextendedproc sp_oacreate,'odsole70.dll' exec sp_addextendedproc sp_oadestroy,'odsole70.dll' exec sp_addextendedproc sp_oageterrorinfo,'odsole70.dll' exec sp_addextendedproc sp_oagetproperty,'odsole70.dll' exec sp_addextendedproc sp_oamethod,'odsole70.dll' exec sp_addextendedproc sp_oasetproperty,'odsole70.dll' exec sp_addextendedproc sp_oastop,'odsole70.dll' exec sp_addextendedproc xp_regaddmultistring,'xpstar.dll' exec sp_addextendedproc xp_regdeletekey,'xpstar.dll' exec sp_addextendedproc xp_regdelete,'xpstar.dll' exec sp_addextendedproc xp_regenums,'xpstar.dll' exec sp_addextendedproc xp_regread,'xpstar.dll' exec sp_addextendedproc xp_regremovemultistring,'xpstar.dll' exec sp_addextendedproc xp_regwrite,'xpstar.dll'

以上語句是自動生成的。感興趣你可以看一下以下語句,上邊的語句就是這麼生成的。由於我機器上的擴充套件儲存過程沒有drop掉,所以可以生成上邊的語句。

create table #temp( name varchar(100),dll varchar(100))

truncate table #temp

insert into #temp exec sp_helpextendedproc 'xp_cmdshell' insert into #temp exec sp_helpextendedproc 'xp_dirtree' insert into #temp exec sp_helpextendedproc 'xp_enumgroups' insert into #temp exec sp_helpextendedproc 'xp_fixeddrives' insert into #temp exec sp_helpextendedproc 'xp_loginconfig' insert into #temp exec sp_helpextendedproc 'xp_enumerrorlogs' insert into #temp exec sp_helpextendedproc 'xp_getfiledetails' insert into #temp exec sp_helpextendedproc 'sp_oacreate' insert into #temp exec sp_helpextendedproc 'sp_oadestroy' insert into #temp exec sp_helpextendedproc 'sp_oageterrorinfo' insert into #temp exec sp_helpextendedproc 'sp_oagetproperty' insert into #temp exec sp_helpextendedproc 'sp_oamethod' insert into #temp exec sp_helpextendedproc 'sp_oasetproperty' insert into #temp exec sp_helpextendedproc 'sp_oastop' insert into #temp exec sp_helpextendedproc 'xp_regaddmultistring' insert into #temp exec sp_helpextendedproc 'xp_regdeletekey' insert into #temp exec sp_helpextendedproc 'xp_regdelete' insert into #temp exec sp_helpextendedproc 'xp_regenums' insert into #temp exec sp_helpextendedproc 'xp_regread' insert into #temp exec sp_helpextendedproc 'xp_regremovemultistring' insert into #temp exec sp_helpextendedproc 'xp_regwrite'

select 'exec sp_addextendedproc '+name+','''+dll+'''' from #temp

刪除與恢復擴充套件儲存過程 SQL 2000資料庫

命令刪除sql的擴充套件 use master exec sp dropextendedproc xp cmdshell exec sp dropextendedproc xp dirtree exec sp dropextendedproc xp enumgroups exec sp dropex...

刪除儲存過程

declare procname varchar 500 declare cur cursor for select name from sys.objects where type p open cur fetch next from cur into procname while fetch s...

刪除儲存過程

儲存過程可以被快速刪除和重建,因為它沒有儲存資料。刪除儲存過程可以使用sql server管理平台和transac sql語句。1.使用sql server管理平台刪除儲存過程 操作步驟如下 1 開啟sql server管理平台,展開結點 物件資源管理器 資料庫伺服器 可程式設計性 儲存過程 選擇要...