MSSQL2000安全设置图文教程

网络整理 - 08-23


下面内容来自网络仅作为参考,其中
exec sp_dropextendedproc 'Xp_regdelete'
exec sp_dropextendedproc 'Xp_regenums'
内容与上文不同,实际使用以上文为准。
命令删除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